Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
752
stars
357
forks
source link
playing multiple audios in same time in background #763
Open
mohamedsalah83 opened 1 year ago
Flutter Version
My version :
Lib Version
My version :
Platform (Android / iOS / web) + version
Platform : android
Describe the bug
some times when i press next or previous button another audios playing in same time in background how can i fix this ?? could anyone help please.
Small code to reproduce
import 'package:assets_audio_player/assets_audio_player.dart'; import 'package:flutter/material.dart'; import 'package:palette_generator/palette_generator.dart'; import 'package:sleek_circular_slider/sleek_circular_slider.dart';
`class PlayerPage extends StatefulWidget { PlayerPage({required this.player, Key? key}) : super(key: key); final AssetsAudioPlayer player;
@override State createState() => _PlayerPageState();
}
class _PlayerPageState extends State {
@override void dispose() {
}
Duration duration = Duration.zero; Duration position = Duration.zero; bool isPlaying = true; @override void initState() { widget.player.isPlaying.listen((event) { if (mounted) { setState(() { isPlaying = event; }); } });
}
@override Widget build(BuildContext context) {
} }`