Add pref to delay play of <video>s until they're visible

RESOLVED FIXED in Firefox 42

Status

()

Core
Audio/Video
RESOLVED FIXED
3 years ago
7 months ago

People

(Reporter: cpearce, Assigned: cpearce)

Tracking

unspecified
mozilla42
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
An idea I've been considering is blocking playback of videos until the page the video is in is visible. I think we should land this preffed off, and see what people think about it.
(Assignee)

Comment 1

3 years ago
Created attachment 8629766 [details] [diff] [review]
Patch: Block play until visible

Block playback of media elements until the media's owner doc becomes visible, whereupon we'll start playback.

Preffed off, to enable set media.block-play-until-visible=true.

We block playback after starting the load, so that we shouldn't slow down playback start on focus.
Attachment #8629766 - Flags: review?(kinetik)
Comment on attachment 8629766 [details] [diff] [review]
Patch: Block play until visible

Review of attachment 8629766 [details] [diff] [review]:
-----------------------------------------------------------------

::: modules/libpref/init/all.js
@@ +270,5 @@
>  // opened as top-level documents, as opposed to inside a media element.
>  pref("media.play-stand-alone", true);
>  
> +// Whether we should delay actioning a "play()" JS function call until the
> +// document in which the media element is present is focused.

Mention autoplay being blocked as well?
Attachment #8629766 - Flags: review?(kinetik) → review+
https://hg.mozilla.org/mozilla-central/rev/570ef52c51e9
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox42: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Blocks: 647429

Updated

2 years ago
See Also: → bug 1297007
You need to log in before you can comment on or make changes to this bug.