Пример #1
0
        private void CustomPlayer_OnMusicStart(object sender, MusicEventArgs e)
        {
            if (!this.SelectedPlayList.Equals(this.PlayingPlayList))
            {
                return;
            }
            if (!IsAdd)
            {
                this.MusicContainer.MusicPlay = this.MusicContainer.playList.musics.First((musicNotify) =>
                {
                    return(musicNotify.musics.Equals(e.music));
                });
            }
            savePlayList?.Invoke(this.PlayListCollections);
            count_music += 1;
            if (count_music >= 5 && this.AD && !IsAdd)
            {
                CustomPlayer.Visibility = Visibility.Hidden;
                CustomPlayer.IsEnabled  = false;
                CustomPlayer.Stop();

                CustomPlayerAd.Visibility = Visibility.Visible;
                CustomPlayerAd.IsEnabled  = false;
                CustomPlayerAd.SetMusic(this.AdMusic);
                CustomPlayerAd.Play();

                IsAdd = true;
            }
        }
Пример #2
0
        private void CustomPlayerAd_OnMusicEnded(object sender, MusicEventArgs e)
        {
            if (IsAdd)
            {
                CustomPlayerAd.Visibility = Visibility.Hidden;
                CustomPlayerAd.IsEnabled  = false;
                CustomPlayerAd.Stop();

                CustomPlayer.Visibility = Visibility.Visible;
                CustomPlayer.IsEnabled  = true;
                CustomPlayer.Play();

                IsAdd       = false;
                count_music = 0;
            }
        }