refactor: ♻️ play remote media stream error handling

This commit is contained in:
Ahmet Kaan Gümüş 2025-05-04 22:30:27 +03:00
parent 7fcac42b7e
commit d54c138607
3 changed files with 16 additions and 5 deletions

View file

@ -74,7 +74,11 @@ pub fn app() -> impl IntoView {
let play_remote_audio_button = button()
.on(leptos::ev::click, move |_| {
let webrtc_audio = webrtc_audio.clone();
spawn_local(get_remote_audio_stream_and_play(webrtc_audio));
spawn_local(async {
get_remote_audio_stream_and_play(webrtc_audio)
.await
.unwrap()
});
})
.child("Play");