Bug 83620 - Media engine should not be told to prepare for playback if media loading is not allowed
Summary: Media engine should not be told to prepare for playback if media loading is n...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-04-10 14:37 PDT by Eric Carlson
Modified: 2012-11-26 16:43 PST (History)
6 users (show)

See Also:


Attachments
Proposed patch (13.11 KB, patch)
2012-04-12 07:54 PDT, Eric Carlson
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2012-04-10 14:37:35 PDT
r93437 add a call to prepareToPlay to HTMLMediaElement::load. prepareToPlay tells the media engine to begin buffering data, so it should not be called if media loading requires a user gesture and load() was not called from one.
Comment 1 Eric Carlson 2012-04-12 07:54:01 PDT
Created attachment 136912 [details]
Proposed patch
Comment 2 Radar WebKit Bug Importer 2012-04-12 12:54:40 PDT
<rdar://problem/11238726>
Comment 3 Eric Carlson 2012-04-12 14:19:43 PDT
http://trac.webkit.org/changeset/114021
Comment 4 Min Qin 2012-11-26 14:56:19 PST
Hi, Eric, this change breaks all the youtube embeds on android. For example: http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html.

And the actual submitted patch is not identical to the proposed patch.

I am wondering whether we can either:
1. remove the exception throwing behavior? If an exception is thrown, no video control and no poster will be shown in chrome. And user will see a black square in the middle of a page.  Or

2. Use the proposed patch, so that we have the RequireUserGestureForLoadRestriction flag.
Comment 5 Eric Carlson 2012-11-26 15:12:53 PST
(In reply to comment #4)
> Hi, Eric, this change breaks all the youtube embeds on android. For example: http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html.
> 
> And the actual submitted patch is not identical to the proposed patch.
> 
> I am wondering whether we can either:
> 1. remove the exception throwing behavior? If an exception is thrown, no video control and no poster will be shown in chrome. And user will see a black square in the middle of a page.  Or
> 
> 2. Use the proposed patch, so that we have the RequireUserGestureForLoadRestriction flag.

We should remove the exception because load() is no longer spec'd to throw.
Comment 6 Min Qin 2012-11-26 16:43:52 PST
(In reply to comment #5)
> (In reply to comment #4)
> > Hi, Eric, this change breaks all the youtube embeds on android. For example: http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html.
> > 
> > And the actual submitted patch is not identical to the proposed patch.
> > 
> > I am wondering whether we can either:
> > 1. remove the exception throwing behavior? If an exception is thrown, no video control and no poster will be shown in chrome. And user will see a black square in the middle of a page.  Or
> > 
> > 2. Use the proposed patch, so that we have the RequireUserGestureForLoadRestriction flag.
> 
> We should remove the exception because load() is no longer spec'd to throw.

Thanks, Eric. I created a patch for this:
https://bugs.webkit.org/show_bug.cgi?id=103318