mirror of
https://github.com/meditohq/medito-app.git
synced 2024-08-17 08:00:29 +03:00
Fix add stream issue (#648)
* fix: add stream issue fixed * fix: add stream when refreshing the app
This commit is contained in:
parent
3acf683cb8
commit
8cb79663b2
@ -152,9 +152,15 @@ class _ParentWidgetState extends ConsumerState<ParentWidget>
|
||||
);
|
||||
onMessageAppOpened(context, ref);
|
||||
initializeNotification(context, ref);
|
||||
initializeAudioPlayer();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
|
||||
void initializeAudioPlayer() {
|
||||
var audioPlayerProvider = ref.read(audioPlayerNotifierProvider);
|
||||
audioPlayerProvider.initAudioHandler();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final goRouter = ref.watch(goRouterProvider);
|
||||
|
@ -32,7 +32,6 @@ class AudioPlayerNotifier extends BaseAudioHandler
|
||||
try {
|
||||
pauseBackgroundSound();
|
||||
unawaited(trackAudioPlayer.pause());
|
||||
unawaited(super.pause());
|
||||
} catch (err) {
|
||||
unawaited(Sentry.captureException(
|
||||
err,
|
||||
@ -57,7 +56,6 @@ class AudioPlayerNotifier extends BaseAudioHandler
|
||||
stackTrace: err,
|
||||
));
|
||||
}
|
||||
unawaited(super.play());
|
||||
}
|
||||
|
||||
@override
|
||||
@ -66,7 +64,6 @@ class AudioPlayerNotifier extends BaseAudioHandler
|
||||
if (mediaItemHasBGSound()) {
|
||||
stopBackgroundSound();
|
||||
}
|
||||
unawaited(super.stop());
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -8,13 +8,12 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
|
||||
final rootCombineProvider = Provider.family<void, BuildContext>((ref, context) {
|
||||
var audioPlayerProvider = ref.read(audioPlayerNotifierProvider);
|
||||
audioPlayerProvider.initAudioHandler();
|
||||
ref.read(remoteStatsProvider);
|
||||
ref.read(authProvider.notifier).saveFcmTokenEvent();
|
||||
ref.read(postLocalStatsProvider);
|
||||
ref.read(deviceAppAndUserInfoProvider);
|
||||
ref.read(audioDownloaderProvider).deleteDownloadedFileFromPreviousVersion();
|
||||
var audioPlayerProvider = ref.read(audioPlayerNotifierProvider);
|
||||
|
||||
var streamEvent = audioPlayerProvider.trackAudioPlayer.playerStateStream
|
||||
.map((event) => event.processingState)
|
||||
|
Loading…
Reference in New Issue
Block a user