Bug 163570 - Last player wins when multiple video elements have 'autoplay', 'muted' and 'playsinline' attributes set
Summary: Last player wins when multiple video elements have 'autoplay', 'muted' and 'p...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 10
Hardware: iPhone / iPad iOS 10
: P2 Blocker
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-17 16:27 PDT by Evol Greaves
Modified: 2016-10-20 09:07 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evol Greaves 2016-10-17 16:27:05 PDT
There are a couple scenarios that I'm seeking clarification on as to whether they are bugs or are working as intended.

Test page: http://demo.jwplayer.com/browser-examples/safari-autoplay.html

On an iPhone with multiple videos on the page:

1. In portrait mode, where there are multiple videos in the viewport, the last video to load is the one that starts playing.
2. In landscape mode, the behavior is as expected with videos playing/pausing as they enter/exit the viewport. However, I'm curious if videos above the fold should resume playback when you scroll up to bring them back into view. According to the documentation: "<video autoplay> elements will pause if they become non-visible, such as by being scrolled out of the viewport." But this does not speak to the use case of resuming playback of a video if it becomes visible again. 

Getting the above 2 scenarios resolved would be a huge win for us at JW Player.

Thanks,
Evol
Comment 1 Jer Noble 2016-10-17 21:15:59 PDT
(In reply to comment #0)
> There are a couple scenarios that I'm seeking clarification on as to whether
> they are bugs or are working as intended.
> 
> Test page: http://demo.jwplayer.com/browser-examples/safari-autoplay.html
> 
> On an iPhone with multiple videos on the page:
> 
> 1. In portrait mode, where there are multiple videos in the viewport, the
> last video to load is the one that starts playing.

This is a result of bug #162366.

> 2. In landscape mode, the behavior is as expected with videos
> playing/pausing as they enter/exit the viewport. However, I'm curious if
> videos above the fold should resume playback when you scroll up to bring
> them back into view. According to the documentation: "<video autoplay>
> elements will pause if they become non-visible, such as by being scrolled
> out of the viewport." But this does not speak to the use case of resuming
> playback of a video if it becomes visible again. 

They should, though this behavior might intersect with the bug above.

> Getting the above 2 scenarios resolved would be a huge win for us at JW
> Player.
> 
> Thanks,
> Evol
Comment 2 Evol Greaves 2016-10-17 22:06:05 PDT
Hi Jer,

Thanks for taking a look at this.

Would the ideal solution be allowing playback of multiple videos with added support for the IntersectionObserver API, making it possible for players to autoplay all videos or just the one that has the greatest intersection with the viewport?
Comment 3 Jer Noble 2016-10-19 10:12:30 PDT
(In reply to comment #2)
> Hi Jer,
> 
> Thanks for taking a look at this.
> 
> Would the ideal solution be allowing playback of multiple videos with added
> support for the IntersectionObserver API, making it possible for players to
> autoplay all videos or just the one that has the greatest intersection with
> the viewport?

That would allow the page to control autoplaying-only-when-visible manually, which I'm sure many page authors are interested in.  But the baseline behavior (<video autoplay> should play when visible) should "just work" once the related "multiple autoplaying videos" bug is fixed.
Comment 4 Evol Greaves 2016-10-19 11:24:42 PDT
Agreed. 

Is there a timeline set for a fix that we can share with our publishers?