Bug 45971

Summary: REGRESSION: r67568-r67643: HTML5 Video on Youtube broken
Product: WebKit Reporter: Kevin M. Dean <kevin>
Component: MediaAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, eric.carlson, jer.noble, simon.fraser
Priority: P2 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://www.youtube.com/watch?v=5xu6QWj7O8M

Description Kevin M. Dean 2010-09-17 10:14:12 PDT
Whenever I try to watch a Youtube video in HTML5 with the latest r67643 Webkit Nightly, the video no longer appears. You can hear the audio playing, just no video.

If you are not already viewing videos on Youtube with HTML5, you can toggle it on at: http://www.youtube.com/html5

Also, with the latest Webkits and the release version of Safari 5.0.2 and possibly earlier, whenever I'm playing an HTML5 video on Youtube, trying to use a Command Key like Command-T, Command-W, or Command-Q has not result. Nothing happens. If I view the Flash version of the page, the Keys work as expected.
Comment 1 Alexey Proskuryakov 2010-09-17 15:31:32 PDT
<rdar://problem/8447261>
Comment 2 Eric Carlson 2010-09-20 08:18:04 PDT
Do you have any Safari extensions installed that change the behavior of YouTube? I was able to reproduce what you describe with YouTube5 1.2.5 installed, but the problems went away as soon as I disabled the extension.
Comment 3 Kevin M. Dean 2010-09-20 09:53:23 PDT
Okay, here's some more detail. I use the YoutubeWide extension which only defaults youtube to the wider view initially instead of the small view.

If I turn it off and play the video it appears fine at first, but as soon as I click the youtube button that's right-pointing and down pointing arrows to enlarge the video the video stops displaying and even shrinking the window back does not return the video.

Clicking the "Full" screen button works fine. It's just the in-interface resizing that broke.

Your Youtube5 extension is likely doing the same thing as toggling the HTML5 beta and also may be providing the Wide-by-default option that I'm using with the YoutubeWide extension. Regardless, the resizing broke for HTML5 playback between the nightly releases.

Also, can anyone confirm the inability to use Command-Keys while on these pages?
Comment 4 Eric Carlson 2010-09-20 10:21:29 PDT
(In reply to comment #3)
> Your Youtube5 extension is likely doing the same thing as toggling the HTML5 beta and also may 
> be providing the Wide-by-default option that I'm using with the YoutubeWide extension. 
> Regardless, the resizing broke for HTML5 playback between the nightly releases.
> 
> Also, can anyone confirm the inability to use Command-Keys while on these pages?
>
Yes, command-keys don't work if the <video> element has focus. Click anywhere else on the page and they work again.

I think this is because they are binding 'keypress' to a function that controls some aspects of display and playback (eg. 'esc' to exit fullscreen, space to play/pause), but it *always* calls preventDefault:

    $.prototype.lc = function (a) {
        a.keyCode == 27 && this.ob && rd(this, k);
        if (a.keyCode == 32 || a.keyCode == 179) ud(this);
        a.keyCode == 178 && this.a.pause();
        a.preventDefault()
    };
Comment 5 Kevin M. Dean 2010-09-23 17:41:44 PDT
r68204 - video stays playing at both sizes again, but when switching between the 2 on-page sizes the video doesn't always position itself back in the right place when switching back to the smaller size.
Comment 6 Kevin M. Dean 2010-09-23 17:44:50 PDT
Oops. ignore previous message. Was running release version of Safari 5.0.2 and not the latest webkit. So, the glitch there is what happens in 5.0.2. r68204 still has the same issue as previously described.
Comment 7 Eric Carlson 2010-09-24 07:06:06 PDT
(In reply to comment #6)
> So, the glitch there is what happens in 5.0.2. r68204 still has the same issue as previously described.

I don't see this problem with a TOT build. Are you seeing this with *no* YouTube Safari extensions installed?
Comment 8 Kevin M. Dean 2010-09-24 08:07:40 PDT
Yes as mentioned in Comment #3, if I turn off all extensions the video still disappears when enlarging (not full screen) through r68242.
Comment 9 Kevin M. Dean 2010-10-06 09:11:57 PDT
Here's another link where I don't even need to resize the video in HTML5 mode. The video doesn't appear at all on first load with the latest Webkit, whereas it works fine with Safari 5.0.2.

http://www.youtube.com/watch?v=FF6hofRRxYs
Comment 10 Eric Carlson 2010-10-12 11:21:03 PDT
(In reply to comment #9)
> Here's another link where I don't even need to resize the video in HTML5 mode. The video 
> doesn't appear at all on first load with the latest Webkit, whereas it works fine with Safari 5.0.2.
> 
> http://www.youtube.com/watch?v=FF6hofRRxYs

I still can't reproduce this, the video plays fine for me on two different machines in WebKit built from TOT sources.

I do see visual "stuttering" when playing this video with the Flash plug-in, it looks like the video was encoded with out-of-order frames and Flash is displaying them in file order instead of timestamp order. 

QuickTime did not always do a good job displaying this type of movie, what version of QuickTime do you have installed?
Comment 11 Kevin M. Dean 2010-10-12 11:40:47 PDT
Earlier you said you were able to reproduce this when using the Youtube5 extension, but you disabled it. Are you set to use the HTML5 version of Youtube? Flash playback should be fine.

The second video link I posted now plays initially as well for me, but if I switch it to the larger view (right + down pointing arrows) the video continues to disappear and doesn't come back. This used to work fine unti the range of nightly releases I listed in the subject.

I'm running 10.5.8 PPC with the latest Webkit under Safari 5.0.2 with the latest QuickTime 7.6.6 available to me.
Comment 12 Kevin M. Dean 2010-10-12 11:49:59 PDT
Found something useful. If I go to the Debug menu and check "Disable Accelerated Compositing" the video comes back and works as expected, so the problem seems to lie there. I can literally toggle that option back and forth and watch the video disappear and reappear all while the video is playing in the Expanded view. Safari 5.0.2 and earlier Webkit releases played fine with the Accelerated Compositing enabled.
Comment 13 Kevin M. Dean 2010-10-12 12:27:53 PDT
I had a friend test with 10.6.4 intel and the latest webkit works fine.

So, the compositing issue is either a 10.5.8 issue, PPC issue, or something specific to my graphics card.

I have a Dual 2.7 GHz G5 with the factory ATI Radeon 9650.
Comment 14 Kevin M. Dean 2010-10-20 00:18:14 PDT
Under r70098, I now get zero playback. Nothing ever appears regardless of compositing setting and the right column of preview thumbnails now do not load either.
Comment 15 Simon Fraser (smfr) 2010-10-20 07:59:13 PDT

*** This bug has been marked as a duplicate of bug 47369 ***
Comment 16 Kevin M. Dean 2010-10-22 10:14:57 PDT
My Bug 45971 was resolved as duplicate of bug 47369, but something introduced with r70098 is breaking things entirely and I don't know if it's unrelated or if the bug 47369 patch fixes anything.

Using Youtube's HTML5 setting, videos no longer appear at all and the video thumbnails don't appear. Read my original bug for more details. The latest glitch started with r70098 and continues with r70284.
Comment 17 Kevin M. Dean 2010-10-22 11:26:23 PDT
I'm re-opening because I can't tell if the other patch fixes it due to the other bigger issue listed in my previous comments.
Comment 18 Simon Fraser (smfr) 2010-10-25 10:20:45 PDT
Both Flash and HTML5 videos work perfectly for me on Leopard, with the r70429 nightly. If you still see issues, please file a new bug with exact details.
Comment 19 Kevin M. Dean 2010-10-25 11:01:57 PDT
Confirmed the r70429 is working as expected now for me as well.