fix: audio play bug for ios safari. (#285)

* fix: audio play bug for ios safari. (WIP).

* chore: Repair and can pop up the playback prompt dialog box correctly.

* chore: add AudioContext to reduce playback delay.
This commit is contained in:
CloudWebRTC
2023-05-16 10:28:09 +08:00
committed by GitHub
parent 2b1e7f2e5f
commit 0b8aeeeba1
10 changed files with 146 additions and 6 deletions
+9
View File
@@ -79,6 +79,15 @@ class _RoomPageState extends State<RoomPage> {
print('Failed to decode: $_');
}
context.showDataReceivedDialog(decoded);
})
..on<AudioPlaybackStatusChanged>((event) async {
if (!widget.room.canPlaybackAudio) {
print('Audio playback failed for iOS Safari ..........');
bool? yesno = await context.showPlayAudioManuallyDialog();
if (yesno == true) {
await widget.room.startAudio();
}
}
});
void _askPublish() async {