Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

silly HTMLMediaElement play() restrictions #11895

Closed
wothke opened this issue Nov 10, 2017 · 2 comments
Closed

silly HTMLMediaElement play() restrictions #11895

wothke opened this issue Nov 10, 2017 · 2 comments
Labels
duplicate Issue has already been reported

Comments

@wothke
Copy link

wothke commented Nov 10, 2017

Description

For some reason the "Brave" developers seem to have taken the decision to restrict use of HTMLMediaElement play() via script. Pages that automatically playback mp3 music using the HTMLMediaElement will no longer work. See respective error message in console:

"Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture.
Uncaught (in promise) DOMException: play() can only be initiated by a user gesture."

It seems "Brave" is not blocking automatic music/mp3 playback per se, but just one specific implementation approach (other implementation approaches still work, e.g. https://www.wothke.ch/modum/).

As you may recall, use of the "built-in" element is advisable so that "shitty" browsers that have problems with mp3's licensing model can still play mp3 using the OS's built-in implementation. Actually there is a good reason why pages are using HTMLMediaElement play() to playback mp3 files: This approach has the benefit that playback can be started as soon enough data has been transmitted - without having to wait for the complete file to have downloaded first. Blocking the script's use of "play()" would force pages to use slower approaches instead making for a more unpleasant user experience - which is unacceptable to me.

On the other hand I don't see any compelling benefit to the user why "play()" should be blocked.

As long as this user unfriendly policy is in place I cannot recommend using "Brave" and I'll keep using one of the other browsers instead (which is unfortunate since apart from this annoying glitch "Brave" looks rather promising).

Steps to Reproduce

  1. e.g. call https://www.wothke.ch/269life/
  2. open developer tools (F12) and you'll see the above error messages...

Brave Version

0.19.88 (Win10 64-bit)

Additional Information

#11527
#10972 (comment)

@luixxiul
Copy link
Contributor

FYI the issue play() does not work has been reported on #10972 (comment) and #11527

@luixxiul
Copy link
Contributor

Closing in favor of #11527.

For some reason the "Brave" developers seem to have taken the decision to restrict use of HTMLMediaElement play() via script.

I do believe that play() has not been blocked intentionally.

@luixxiul luixxiul added the duplicate Issue has already been reported label Nov 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate Issue has already been reported
Projects
None yet
Development

No branches or pull requests

2 participants