livepeer / livepeer-monorepo

JavaScript tools and applications that interact with Livepeer's smart contracts and peer-to-peer network
https://livepeer.org
MIT License
167 stars 71 forks source link

Videoplayer is stuck in "loading" screen when autoplay is explicitly blocked by browser. #984

Closed pblvrt closed 3 years ago

pblvrt commented 3 years ago

Describe the bug (required) A clear and concise description of what the bug is.

Videoplayer is stuck in "loading" screen when autoplay is explicitly blocked by browser.

When testing the @chroma/VideoPlayer component, i am not able to see video playback due to the player being stuck in loading window. I can see from the console that the video playlist and segments are being fetched correctly, and I also see an exception raised:

"Uncaught (in promise) DOMException: The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."

Once I allow video playback component works correctly.

It looks like this could be fixed by handling the exception thrown by await video.play() in @chroma/src/VideoPlayer/index.js

I am using firefox 87.0 (64-bit), I havent tested this issue on other browsers.