Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Podcasts don't play the first time you press the play button in the Blazor web app #141

Open
danroth27 opened this issue Jun 8, 2022 · 2 comments

Comments

@danroth27
Copy link
Member

The first time I try to play a podcast using the Blazor web app I get the following exception in the browser dev console:

       Unhandled Exception:
       Microsoft.JSInterop.JSException: The play() request was interrupted by a new load request.
       undefined
          at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__16`1[[Microsoft.JSInterop.Infrastructure.IJSVoidResult, Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext()
          at Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(IJSObjectReference jsObjectReference, String identifier, Object[] args)
          at Podcast.Components.AudioInterop.PlayAsync(ElementReference element) in C:\Users\daroth\Documents\GitHub\microsoft\dotnet-podcasts\src\Web\Components\AudioInterop.cs:line 19
          at Podcast.Pages.Shared.Player.Audio.OnPlayingChanged(Boolean play) in C:\Users\daroth\Documents\GitHub\microsoft\dotnet-podcasts\src\Web\Pages\Shared\Player\Audio.razor:line 97
          at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
          at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
          at System.Threading.ThreadPoolWorkQueue.Dispatch()
          at System.Threading.ThreadPool.Callback()
       ThreadPool Callback threw an unhandled exception of type Microsoft.JSInterop.JSException

If I stop play and try to play again the podcast plays fine.

In general, to play a podcast I'm finding I have to click the play button once, pause it, and then play it again to hear sound.

@danroth27
Copy link
Member Author

Seems to be caused by c3f31b9. If I revert that commit the audio plays without error the first time you press play.

@ghost
Copy link

ghost commented Aug 16, 2022

Same

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant