Bug 129525 - [MSE] YouTube videos fail to play
Summary: [MSE] YouTube videos fail to play
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-28 17:47 PST by Jer Noble
Modified: 2014-03-03 12:43 PST (History)
7 users (show)

See Also:


Attachments
Patch (12.87 KB, patch)
2014-02-28 17:59 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion (497.38 KB, application/zip)
2014-02-28 19:26 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 (467.91 KB, application/zip)
2014-02-28 20:01 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion (497.31 KB, application/zip)
2014-02-28 20:24 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 (465.19 KB, application/zip)
2014-02-28 20:50 PST, Build Bot
no flags Details
Patch (15.08 KB, patch)
2014-02-28 22:03 PST, Jer Noble
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2014-02-28 17:47:01 PST
[MSE] YouTube videos fail to play
Comment 1 Jer Noble 2014-02-28 17:59:04 PST
Created attachment 225516 [details]
Patch

Uploading work-in-progress patch. The view controller presentViewController:animated:completion: method is non-cancellable, so we should probably look into adding a delegate which can exit full screen only once the animation into full screen completes.
Comment 2 Jer Noble 2014-02-28 18:00:24 PST
(In reply to comment #1)
> Created an attachment (id=225516) [details]
> Work in progress
> 
> Uploading work-in-progress patch. The view controller presentViewController:animated:completion: method is non-cancellable, so we should probably look into adding a delegate which can exit full screen only once the animation into full screen completes.

Ignore this comment. I ran `!webkit-patch` from the wrong  window.  The patch is good though!
Comment 3 Build Bot 2014-02-28 19:26:18 PST
Comment on attachment 225516 [details]
Patch

Attachment 225516 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/4511776741785600

New failing tests:
media/media-source/media-source-monitor-source-buffers.html
media/media-source/media-source-addsourcebuffer.html
Comment 4 Build Bot 2014-02-28 19:26:20 PST
Created attachment 225521 [details]
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-01  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 5 Build Bot 2014-02-28 20:01:45 PST
Comment on attachment 225516 [details]
Patch

Attachment 225516 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/4544281859588096

New failing tests:
media/media-source/media-source-monitor-source-buffers.html
media/media-source/media-source-addsourcebuffer.html
Comment 6 Build Bot 2014-02-28 20:01:48 PST
Created attachment 225522 [details]
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-11  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 7 Build Bot 2014-02-28 20:24:05 PST
Comment on attachment 225516 [details]
Patch

Attachment 225516 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6614051027156992

New failing tests:
media/media-source/media-source-monitor-source-buffers.html
media/media-source/media-source-addsourcebuffer.html
Comment 8 Build Bot 2014-02-28 20:24:08 PST
Created attachment 225529 [details]
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-02  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 9 Build Bot 2014-02-28 20:50:54 PST
Comment on attachment 225516 [details]
Patch

Attachment 225516 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5803540131872768

New failing tests:
media/media-source/media-source-monitor-source-buffers.html
media/media-source/media-source-addsourcebuffer.html
Comment 10 Build Bot 2014-02-28 20:50:56 PST
Created attachment 225533 [details]
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-14  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 11 Jer Noble 2014-02-28 22:03:46 PST
Created attachment 225539 [details]
Patch
Comment 12 Darin Adler 2014-03-01 16:19:34 PST
Comment on attachment 225539 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225539&action=review

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1185
> +    if (!m_bufferedSinceLastMonitor)
> +        return;

Why do this after computing the values above? I suggest moving this line of code up to the top of the function.

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1203
> +    double nearest = m_buffered->nearest(m_source->currentTime());
> +    double currentTime = m_source->currentTime();

Lets evaluate this in the reverse order so we can use currentTime to compute nearest. Seems more logical what way too. In fact, I probably would not put nearest into a local variable at all.

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1204
> +    return abs(nearest - currentTime) <= CurrentTimeFudgeFactor;

This is wrong. Calling abs here converts the result to an integer. We want to call fabs. This also means this code wasn’t working before; instead of 1/24 second our threshold was more like 1 second. Is there some way we can test to make sure it is really working?

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1214
> +    return m_buffered->end(found, IGNORE_EXCEPTION) - currentTime > CurrentTimeFudgeFactor;

Isn’t ASSERT_NO_EXCEPTION what we want, rather than IGNORE_EXCEPTION? And further, Antti has been encouraging us not to use the public DOM functions in internal WebKit code in this way, so it would be nice to avoid it entirely.

> Source/WebCore/Modules/mediasource/SourceBuffer.h:88
> +    bool hasCurrentTime();
> +    bool hasFutureTime();
> +    bool canPlayThrough();

Why aren’t any of these functions const? I guess canPlayThrough has some serious side effects. But the other two don’t.
Comment 13 Jer Noble 2014-03-03 10:21:52 PST
(In reply to comment #12)
> (From update of attachment 225539 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=225539&action=review
> 
> > Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1185
> > +    if (!m_bufferedSinceLastMonitor)
> > +        return;
> 
> Why do this after computing the values above? I suggest moving this line of code up to the top of the function.

Done.

> > Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1203
> > +    double nearest = m_buffered->nearest(m_source->currentTime());
> > +    double currentTime = m_source->currentTime();
> 
> Lets evaluate this in the reverse order so we can use currentTime to compute nearest. Seems more logical what way too. In fact, I probably would not put nearest into a local variable at all.

Ok, changed.

> > Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1204
> > +    return abs(nearest - currentTime) <= CurrentTimeFudgeFactor;
> 
> This is wrong. Calling abs here converts the result to an integer. We want to call fabs. This also means this code wasn’t working before; instead of 1/24 second our threshold was more like 1 second. Is there some way we can test to make sure it is really working?

Whoops.  Yeah, I think this should be testable.  I'll add this.

> > Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1214
> > +    return m_buffered->end(found, IGNORE_EXCEPTION) - currentTime > CurrentTimeFudgeFactor;
> 
> Isn’t ASSERT_NO_EXCEPTION what we want, rather than IGNORE_EXCEPTION? And further, Antti has been encouraging us not to use the public DOM functions in internal WebKit code in this way, so it would be nice to avoid it entirely.

Eric just made a change where TimeRanges are just wrappers around PlatformTimeRanges.  I'll use those methods.

> > Source/WebCore/Modules/mediasource/SourceBuffer.h:88
> > +    bool hasCurrentTime();
> > +    bool hasFutureTime();
> > +    bool canPlayThrough();
> 
> Why aren’t any of these functions const? I guess canPlayThrough has some serious side effects. But the other two don’t.

Sure, I'll make the has* methods const.
Comment 14 Jer Noble 2014-03-03 12:43:03 PST
Committed r164999: <http://trac.webkit.org/changeset/164999>