mirror of
https://github.com/stonega/tsacdop
synced 2025-02-17 20:10:37 +01:00
Minor change.
This commit is contained in:
parent
fe63491c55
commit
7ab21d59bc
@ -19,10 +19,10 @@ import '../state/setting_state.dart';
|
||||
import '../type/episodebrief.dart';
|
||||
import '../type/playlist.dart';
|
||||
import '../util/audiopanel.dart';
|
||||
import '../util/custom_popupmenu.dart';
|
||||
import '../util/custom_widget.dart';
|
||||
import '../util/episodegrid.dart';
|
||||
import '../util/extension_helper.dart';
|
||||
import '../util/mypopupmenu.dart';
|
||||
import 'audioplayer.dart';
|
||||
import 'download_list.dart';
|
||||
import 'home_groups.dart';
|
||||
|
@ -245,6 +245,19 @@ class AudioPlayerNotifier extends ChangeNotifier {
|
||||
await lastWorkStorage.saveInt(0);
|
||||
}
|
||||
|
||||
playlistLoad() async {
|
||||
await _queue.getPlaylist();
|
||||
_backgroundAudioDuration = 0;
|
||||
_backgroundAudioPosition = 0;
|
||||
_seekSliderValue = 0;
|
||||
_episode = _queue.playlist.first;
|
||||
_queueUpdate = !_queueUpdate;
|
||||
_audioState = AudioProcessingState.none;
|
||||
_playerRunning = true;
|
||||
notifyListeners();
|
||||
_startAudioService(_lastPostion ?? 0, _queue.playlist.first.enclosureUrl);
|
||||
}
|
||||
|
||||
Future<void> episodeLoad(EpisodeBrief episode,
|
||||
{int startPosition = 0}) async {
|
||||
print(episode.enclosureUrl);
|
||||
@ -395,7 +408,7 @@ class AudioPlayerNotifier extends ChangeNotifier {
|
||||
await positionStorage.saveInt(_lastPostion);
|
||||
final history = PlayHistory(_episode.title, _episode.enclosureUrl,
|
||||
backgroundAudioPosition ~/ 1000, seekSliderValue);
|
||||
dbHelper.saveHistory(history);
|
||||
await dbHelper.saveHistory(history);
|
||||
}
|
||||
if (event is Map && event['playerRunning'] == false) {
|
||||
_playerRunning = false;
|
||||
@ -440,19 +453,6 @@ class AudioPlayerNotifier extends ChangeNotifier {
|
||||
});
|
||||
}
|
||||
|
||||
playlistLoad() async {
|
||||
await _queue.getPlaylist();
|
||||
_backgroundAudioDuration = 0;
|
||||
_backgroundAudioPosition = 0;
|
||||
_seekSliderValue = 0;
|
||||
_episode = _queue.playlist.first;
|
||||
_queueUpdate = !_queueUpdate;
|
||||
_audioState = AudioProcessingState.none;
|
||||
_playerRunning = true;
|
||||
notifyListeners();
|
||||
_startAudioService(_lastPostion ?? 0, _queue.playlist.first.enclosureUrl);
|
||||
}
|
||||
|
||||
playNext() async {
|
||||
await AudioService.skipToNext();
|
||||
}
|
||||
@ -651,7 +651,7 @@ class AudioPlayerTask extends BackgroundAudioTask {
|
||||
final List<MediaItem> _queue = [];
|
||||
final AudioPlayer _audioPlayer = AudioPlayer();
|
||||
AudioProcessingState _skipState;
|
||||
bool _playing;
|
||||
bool _playing = false;
|
||||
bool _interrupted = false;
|
||||
bool _stopAtEnd;
|
||||
int _cacheMax;
|
||||
|
Loading…
x
Reference in New Issue
Block a user