-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebTorrent: Autoplay is sometimes blocked if media metadata is not ready yet #5471
Comments
Fix: brave/brave-browser#5471 If the media element does not have metadata available immediately when the media viewer loads, then autoplay will fail with a `DOMException`. So, we now wait for the metadata to be loaded before calling `play()`.
@feross looks like this is still happening here and there. It takes a few tries to reproduce on a new profile, but you'll eventually run into the following: Used the following build:
I couldn't reproduce the above using https://webtorrent.io/torrents/wired-cd.torrent though. Maybe it's based on timing? I was running through the case pretty quickly. We can definitely label this as verified as it's a big improvement compared the previous behaviouor. @feross thoughts? |
Yeah, I noticed this as well. The fix felt a little hacky, but it now works like 95% of the time, which is better than 0%. I wish there was some easy way to just disable autoplay policy for the WebTorrent extension. I wonder if @yrliou has any ideas how to do this or who to ask. |
@darkdh suggestions for this one? |
We have autoplay whitelist (https://github.com/brave/autoplay-whitelist) but it only support url host right now (https://github.com/brave/autoplay-whitelist/blob/master/data/autoplay.json) |
I can confirm that adding |
Didn't you say that you were already able to add the WebTorrent extension URL into the whitelist? So shouldn't the issue actually be to add WebTorrent to the list by default? |
The thing we added above is "Content Setting", the brave autoplay list is beyond that. |
@darkdh Thanks for explaining the distinction. Makes sense! |
Verification passed on
The issue still reproduces. Logged #6195. Verification PASSED on
Verification passed on
|
Description
If the media element does not have metadata available immediately when the media viewer loads, then autoplay will fail with a
DOMException
.Steps to Reproduce
Actual result:
Media sometimes does not autoplay.
Expected result:
Media should always autoplay.
Reproduces how often:
Intermittent issue
Brave version (brave://version info)
master
The text was updated successfully, but these errors were encountered: