[Bug 13383] New: Feature request: pause media when hidden

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13383

           Summary: Feature request: pause media when hidden
           Product: HTML WG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: media
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: samdutton@gmail.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


Use cases:
- open multiple autoplay videos in multiple browser windows or tabs (for
example, when a user Ctrl-clicks on multiple video links)
- move between windows or tabs that have audio playing in them (for example,
when a user is listening to two radio stations)
- minimise a window with a video playing in it.

Desired behaviour:
- media is paused (even if set to autoplay) when opened in a page that is
hidden
- media is paused when the page it’s on becomes hidden
- media play resumes when the page it’s on becomes visible, if the media was
playing when the page became hidden, or the media was set to autoplay and never
started.

Proposed solution:
- provide media elements with a pauseifhidden attribute that defaults to true
(but maybe an attribute with multiple possible values, to cope with a greater
variety of use cases, would be more sensible?)

Implementation:
- this feature could make use of the work done on the Page Visibility API
though it might also make sense for media to pause when the page it’s on loses
focus, not just when the page becomes hidden.

Prototypes:
- for browsers that support the Page Visibility API I've built a demo that
pauses video when it's hidden: http://www.samdutton.com/pageVisibility
- for versions of Chrome that support the API (Chrome 13+) I've built an
extension that uses the Page Visibility API to pause video playback in hidden
tabs:
https://chrome.google.com/webstore/detail/ojpfpnnblmkgkpobiamilejllmkfmflg

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Wednesday, 27 July 2011 10:08:22 UTC