示例#1
0
        public async void PlayTracks(AudioPlayerMode audioPlayerMode)
        {
            AudioPlayerMode = audioPlayerMode;
            int trackId = Playlist?.FirstOrDefault() ?? 0;

            await PlayTrack(trackId);
        }
示例#2
0
        public async void PlayTracks(AudioPlayerMode audioPlayerMode)
        {
            AudioPlayerMode = audioPlayerMode;
            int trackId = Playlist?.FirstOrDefault() ?? 0;

            if (trackId > 0)
            {
                Track track = await _dataService.GetTrackById(trackId);

                if (track != null)
                {
                    _playerService.SetTrack(track);
                }
            }
        }
示例#3
0
 public void PlayTracks(ObservableCollection <int> trackIds, AudioPlayerMode audioPlayerMode)
 {
     _playerService.Stop();
     Playlist = trackIds.ToNavigableCollection();
     PlayTracks(audioPlayerMode);
 }
 protected virtual void PlayTracks(IEnumerable <int> trackIds, AudioPlayerMode audioPlayerMode)
 {
     _playerManager.PlayTracks(
         new ObservableCollection <int>(trackIds),
         audioPlayerMode);
 }
示例#5
0
 /// <summary>
 ///  给播放器设置一个 播放列表
 /// </summary>
 /// <param name="list"></param>
 public void SetAudioListAndPlay(List <AudioClip> list, AudioPlayerMode playMode)
 {
     PlayMode  = playMode;
     audioList = list;
     Play(0);
 }