New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 695258 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

'sourceopen' event not fired when chrome tab is in background

Reported by bryanshe...@gmail.com, Feb 23 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce the problem:
1. Open this fiddle in chrome (https://jsfiddle.net/6f6L1ke4/2/), and use middle-button to click on the link "middle-button click me";
2. Wait for a few seconds and then navigate to the new tab;
3. Verified that the time it takes to emit the 'sourceopen' event was similar to the waited duration.

What is the expected behavior?
We expected to see the 'sourceopen' event fired immediately after .src is set. 

What went wrong?
'sourceopen' is not fired for a tab in background

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 56.0.2924.87  Channel: stable
OS Version: OS X 10.12.1
Flash Version:

 
The fiddle for the 'sourceopen' test page: https://jsfiddle.net/s69r7csL/

Comment 2 Deleted

Comment 3 by bmau...@fb.com, Feb 23 2017

Labels: DevRel-Facebook
Cc: avayvod@chromium.org sande...@chromium.org
IIRC we only start the video when the tab is visible. I'm not sure when the source selection algorithm will run.

CC sandersd and avayvod to confirm.
Status: Untriaged (was: Unconfirmed)

Comment 6 Deleted

Is this the intended behavior? On firefox, "sourceopen" is called immediately regardless whether the tab is background or not
Status: WontFix (was: Untriaged)
This is the intended behavior. Chromium defers loading of background video on all platforms.

As I understand it, this is partly a resource optimization, but mostly a correctness issue related to prerendering.

When prerendering is fully removed (issue 678332), we may change this strategy. (That is, rely more heavily on background pause, background video track removal, and background suspend.)
FYI, the relevant code path is ChromeContentRendererClient::DeferMediaLoad(), see https://cs.chromium.org/chromium/src/chrome/renderer/chrome_content_renderer_client.cc?l=627.
And I've just realized that I linked to a restricted issue. The prerendering design is http://goo.gl/EJjTCM and there is an Intent to Implement on the blink-dev mailing list.
Thanks. Is there an API for the page to know that 'sourceopen' is blocked because of this restriction?
The Page Visibility API can be used to determine both whether the page is hidden and whether it is prerendering. There is no API to directly test whether loading is deferred (the spec does not require the browser to complete the load steps quickly).

Note that autoplay restrictions (which apply to play() rather than load()) are different; play() returns a Promise which will be rejected when autoplay is prevented.

Sign in to add a comment