public void SetSubtitleTrack(DictionaryKeyValue subTrack) { _currentSubtitle = _subtitlesTracks.IndexOf(subTrack); if (subTrack != null) { _mediaService.SetSubtitleTrack(subTrack.Id); } }
public void SetAudioTrack(DictionaryKeyValue audioTrack) { _currentAudioTrack = _audioTracks.IndexOf(audioTrack); if (audioTrack != null) { _mediaService.SetAudioTrack(audioTrack.Id); } }
public List <KeyValue> GetAllKeyValueByKeyTypeIntCode(string keyTypeIntCode) { List <KeyValue> list = new List <KeyValue>(); KeyType keyType = DictionaryKeyType.Where(d => d.Value.KeyTypeIntCode == keyTypeIntCode).FirstOrDefault().Value; foreach (var item in DictionaryKeyValue.Where(k => k.Value.idKeyType == keyType.idKeyType).OrderBy(o => o.Value.Name).ToList()) { list.Add(item.Value); } return(list); }
private async void OnMediaTrackAdded(TrackType type, int trackId, string name) { var item = new DictionaryKeyValue { Id = trackId, Name = name }; await DispatchHelper.InvokeInUIThread(CoreDispatcherPriority.Normal, () => { if (type == TrackType.Audio) { if (AudioTracks.Count == 0) { AudioTracks.Add(new DictionaryKeyValue { Id = -1, Name = "Disabled" }); } AudioTracks.Add(item); if (_currentAudioTrack == null) { _currentAudioTrack = item; } OnPropertyChanged(nameof(AudioTracks)); OnPropertyChanged(nameof(CurrentAudioTrack)); } else if (type == TrackType.Subtitle) { if (Subtitles.Count == 0) { Subtitles.Add(new DictionaryKeyValue { Id = -1, Name = "Disabled" }); } Subtitles.Add(item); if (_currentSubtitle == null) { _currentSubtitle = item; } OnPropertyChanged(nameof(Subtitles)); OnPropertyChanged(nameof(CurrentSubtitle)); } else { Locator.NavigationService.Go(VLCPage.VideoPlayerPage); } }); }
public List <KeyValue> GetAllKeyValueByKeyTypeIntCode(string keyTypeIntCode, string columnToOrderBy) { List <KeyValue> list = new List <KeyValue>(); KeyType keyType = DictionaryKeyType.Where(d => d.Value.KeyTypeIntCode == keyTypeIntCode).FirstOrDefault().Value; var data = DictionaryKeyValue.Where(k => k.Value.idKeyType == keyType.idKeyType).OrderBy(o => o.Value.Name).Select(s => s.Value).ToList(); data = BaseClassBL <KeyValue> .Sort(data, columnToOrderBy, Constants.SORTING_ASC).ToList(); foreach (var item in data) { list.Add(item); } return(list); }