public async void PlayTracks(AudioPlayerMode audioPlayerMode) { AudioPlayerMode = audioPlayerMode; int trackId = Playlist?.FirstOrDefault() ?? 0; await PlayTrack(trackId); }
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); } } }
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); }
/// <summary> /// 给播放器设置一个 播放列表 /// </summary> /// <param name="list"></param> public void SetAudioListAndPlay(List <AudioClip> list, AudioPlayerMode playMode) { PlayMode = playMode; audioList = list; Play(0); }