Open khashabawy opened 4 years ago
`I/flutter (10898): onPlay()
[log] play() > قصيدة الشاعر حافظ إبراهيم عن العربية
[log] PlayPause > play()
[log] isOnhold > false
I/flutter (10898): onPlay()
I/flutter (10898): onPlay()
[log] PlayPause > pause()
[log] isOnhold > true
I/flutter (10898): onPlay()
[log] pause()
I/flutter (10898): onPlay()
[log] play() > قصيدة الشاعر حافظ إبراهيم عن العربية
[log] PlayPause > play()
[log] isOnhold > false
I/flutter (10898): onPlay()
I/flutter (10898): onPlay()`
Future<void> play({bool reset: true}) async {
if(isPlaying == false && playerState != PlayerState.PLAYING) {
if (streamData.file == null) {
return;
}
if (isPlaying && reset == true) {
await stop();
}
dev.log('play() > ' + streamData.title);
try {
await audioInstance.play(
streamData.file,
title: streamData.title,
subtitle: streamData.subtitle,
position: playbackPosition,
isLiveStream: true,
);
setState(() {
buffering = true;
});
} on PlatformException catch (e) {
throw 'Unable to play ${streamData.title}: ${e.message}';
}
}
}
If there is any chance to help me about this i would be grateful
I/flutter ( 7268): onPlay() is Fired Twice, Can You tell the reason for that please ?