Open Bug 1489291 Opened 6 years ago Updated 2 years ago

playback doesn't start when you click on the video without control while the autoplay permission doorhanger is showing

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

People

(Reporter: jya, Unassigned)

References

()

Details

STR: 1- Open https://jyavenard.github.io/htmltests/tests/1488520.html 2- A doorhanger asking to allow autoplay will show 3- Note that the play promise isn't yet resolved (the text "waiting on play promise to be resolved" is displayed) 3- Click on the video, but outside the doorhanger 4- The doorhanger disappear, and the promise isn't resolved (nor rejected) What happens: Playback doesn't start. What should happen: playback should start. the user has interacted with the page, and play() got called. The promise returned by play() should be resolved.
Summary: playback doesn't start when you click on the video while a doorhanger is showing → playback doesn't start when you click on the video while the autoplay permission doorhanger is showing
(In reply to Jean-Yves Avenard [:jya] from comment #0) > STR: > 1- Open https://jyavenard.github.io/htmltests/tests/1488520.html > 2- A doorhanger asking to allow autoplay will show > 3- Note that the play promise isn't yet resolved (the text "waiting on play > promise to be resolved" is displayed) > 3- Click on the video, but outside the doorhanger > 4- The doorhanger disappear, and the promise isn't resolved (nor rejected) After your step(3), the doorhanger didn't disappear, it was still there.
sorry.. then What should happen amendment: playback should start, the doorhanger should disappear: the user has interacted with the page, and play() got called. The promise returned by play() should be resolved to complete the play() steps as per spec
After user activate the site, we would allow media to autoplay. However, if the play is called before user activation and the default autoplay setting is "Always ask", then the status of this play promise would only depend on the prompt response. That means, user activation would not affect the promise which was called before it. Jya's proposal is that, user activation should also affect the play promise which was called before the user activation. I would prefer not to do this change, my reason is that I don't like to mix the doorhanger and user activation together. If the doorhanger is showing, that means it should be the only desingated way to make user decide whether media can start autoplay, except they manually start media by themselve. If mixing two things together, that means when user click other place (might be outside the video), the video would start playing even user haven't replied the doorhanger. I think it would cause user's confusion. However, if the point of this bug is focus on "clicking video should start media and dismiss the doorhanger", then I think the solution would be that the video control should provide "click-to-play" icon (bug1166961) in desktop as well in order to make user more easily start video. (Note, this feature is broke now, tracking in bug1487143) --- Hi, Chris, May I have your idea here? Thank you.
Flags: needinfo?(cpearce)
Summary: playback doesn't start when you click on the video while the autoplay permission doorhanger is showing → playback doesn't start when you click on the video without control while the autoplay permission doorhanger is showing
FYI, if the video has control interface, then this issue won't happen. Because the video control would call video.play() when user clicks on the video.
Priority: -- → P3
I don't think gesture activating anywhere in the page should unblock pending play promises. Clicking on an arbitrary place does not demonstrate user intent to play video. I think if the user gesture activates a page and then clicks a play button to cause script to call video.play() and the video plays we should resolve any pending play promises. I implemented this behaviour already. I think we should resolve/wontfix this bug.
Flags: needinfo?(cpearce)
it's not really clicking anywhere... it's clicking on the video...
If you click on the video and that triggers a click handler which calls play() on the video, the video will play. So in your example, if you turn on the video's built-in video controls and then click on the video, the video plays. Are you asking for videos with built in controls disabled to by default have a click handler that plays the video on-click?
(In reply to Chris Pearce (:cpearce) from comment #7) > If you click on the video and that triggers a click handler which calls > play() on the video, the video will play. So in your example, if you turn on > the video's built-in video controls and then click on the video, the video > plays. Since the video jya clicked did NOT have video control, so there is no any video.play() when clicking the video. > Are you asking for videos with built in controls disabled to by default have > a click handler that plays the video on-click? I believe it's a right way to solve this issue, instead of resolving the pending promises when user interacts with the page.
Blocks: 1493738
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.