Closed Bug 1180563 Opened 9 years ago Closed 9 years ago

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

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: cpearce, Assigned: cpearce)

References

Details

Attachments

(1 file)

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.
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
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
See Also: → 1297007
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: