mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-17 06:49:34 +00:00
播放逻辑修改
This commit is contained in:
parent
420438c0df
commit
50a27fdf67
33 changed files with 788 additions and 761 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:vaani/shared/audio_player.dart';
|
||||
|
||||
/// this timer pauses the music player after a certain duration
|
||||
///
|
||||
|
|
@ -32,7 +32,7 @@ class SleepTimer {
|
|||
}
|
||||
|
||||
/// The player to be paused
|
||||
final AudioPlayer player;
|
||||
final AbsAudioPlayer player;
|
||||
|
||||
/// The timer that will pause the player
|
||||
Timer? timer;
|
||||
|
|
@ -49,9 +49,9 @@ class SleepTimer {
|
|||
|
||||
SleepTimer({required duration, required this.player}) : _duration = duration {
|
||||
_subscriptions.add(
|
||||
player.playbackEventStream.listen((event) {
|
||||
if (event.processingState == ProcessingState.completed ||
|
||||
event.processingState == ProcessingState.idle) {
|
||||
player.playerStateStream.listen((event) {
|
||||
if (event.processingState == AbsProcessingState.completed ||
|
||||
event.processingState == AbsProcessingState.idle) {
|
||||
clearCountDownTimer();
|
||||
}
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue