Exemplo n.º 1
0
        private void ShowEpisodeInfo(MediaEpisode episode)
        {
            if (episode == null)
            {
                return;
            }

            mediaTitleTxt.Text = episode.EpisodeName;

            languangesComboBox.Items.Clear();
            if (episode.Languges != null && episode.Languges.Count > 0)
            {
                languangesComboBox.Items.Clear();
                episode.Languges.ForEach(language => languangesComboBox.Items.Add(episode.GetLanguageFullName(language)));
            }
            else
            {
                languangesComboBox.Items.Add("Default");
            }

            var audioTrack = player.GetSelectedAudio()?.Language;

            selectedlang = episode.GetLanguageFullName(audioTrack);

            for (int i = 0; i < languangesComboBox.Items.Count; i++)
            {
                if (selectedlang == languangesComboBox.Items[i].ToString())
                {
                    languangesComboBox.SelectedIndex = i;
                    break;
                }
            }
        }
Exemplo n.º 2
0
        public MediaInfoPopup(MediaInfo currentMedia, MediaElement mediaPlayer) : this()
        {
            player = mediaPlayer;
            mediaPlayer.MediaChanging += MediaPlayer_MediaChanging;

            episode = currentMedia.ToMediaEpisode();
            ShowEpisodeInfo(episode);
        }
Exemplo n.º 3
0
        public static MediaEpisode ToMediaEpisode(this MediaInfo mediaInfo)
        {
            if (string.IsNullOrEmpty(mediaInfo?.MediaSource))
            {
                return(null);
            }

            var episode = new MediaEpisode(mediaInfo.MediaSource);

            episode.AddLanguages(GetLanguages(mediaInfo));
            return(episode);
        }