Bug 24638 - [GTK] HTML5 media tags do not work
Summary: [GTK] HTML5 media tags do not work
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Gustavo Noronha (kov)
URL: http://www.double.co.nz/video_test/
Keywords: Gtk
: 16985 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-03-16 21:23 PDT by Gustavo Noronha (kov)
Modified: 2009-09-23 09:50 PDT (History)
2 users (show)

See Also:


Attachments
fix for duration (3.17 KB, patch)
2009-03-16 22:37 PDT, Gustavo Noronha (kov)
no flags Details | Formatted Diff | Diff
fix repainting (5.73 KB, patch)
2009-03-16 22:37 PDT, Gustavo Noronha (kov)
no flags Details | Formatted Diff | Diff
fix buffering (2.27 KB, patch)
2009-03-16 22:38 PDT, Gustavo Noronha (kov)
no flags Details | Formatted Diff | Diff
enable passing tests (2.35 KB, patch)
2009-03-16 22:39 PDT, Gustavo Noronha (kov)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Noronha (kov) 2009-03-16 21:23:14 PDT
If you visit the URI I added to the bug report you'll notice that the video doesn't play. There are two main problems, really:

1) MediaPlayerPrivate::duration is returning 0 because gst_element_query_duration returns true even though it isn't able to figure out the duration in time format.

2) Nothing calls MediaPlayerPrivate::repaint when the sink draws the frame in the surface, so the video only gets updated when expose events or other conditions force the repaint
Comment 1 Gustavo Noronha (kov) 2009-03-16 22:24:59 PDT
3) When buffering the stream is not paused, so the video plays badly
Comment 2 Gustavo Noronha (kov) 2009-03-16 22:37:00 PDT
Created attachment 28678 [details]
fix for duration
Comment 3 Gustavo Noronha (kov) 2009-03-16 22:37:45 PDT
Created attachment 28679 [details]
fix repainting
Comment 4 Gustavo Noronha (kov) 2009-03-16 22:38:25 PDT
Created attachment 28680 [details]
fix buffering
Comment 5 Gustavo Noronha (kov) 2009-03-16 22:39:00 PDT
Created attachment 28681 [details]
enable passing tests
Comment 6 Mark Rowe (bdash) 2009-03-16 22:43:51 PDT
Comment on attachment 28679 [details]
fix repainting

> +void mediaPlayerPrivateRepaintCallback(WebKitVideoSink* sink, gpointer data)
> +{
> +    MediaPlayerPrivate* playerPrivate = static_cast<MediaPlayerPrivate*>(data);
> +    playerPrivate->repaint();
> +}

The function should be declared static, and the name of the first argument omitted since it is unused.  You could probably do away with the local variable too without losing any clarity.

r=me
Comment 7 Mark Rowe (bdash) 2009-03-16 22:46:33 PDT
Comment on attachment 28680 [details]
fix buffering

What happens here if I explicitly hit "play" while a large video is buffering?  It seems like the video would pause itself until it completes loading, even though it may have buffered sufficiently for it to be watchable.  Does that match the spec?

What happens if I hit play and then explicitly pause the video while it is still loading?  It seems like the video would start itself playing when it finishes loading.  Does that match the spec?
Comment 8 Mark Rowe (bdash) 2009-03-16 22:50:17 PDT
Comment on attachment 28678 [details]
fix for duration

This seems as though it will treat a zero-length video as streaming?  Does that behavior match the spec and/or other browsers?
Comment 9 Mark Rowe (bdash) 2009-03-16 22:51:22 PDT
Comment on attachment 28681 [details]
enable passing tests

It would be preferable for the comment to explain, with reference to a bug, why specific tests are disabled.
Comment 10 Holger Freyther 2009-03-16 22:56:35 PDT
Comment on attachment 28678 [details]
fix for duration

sorry, due mark's comments I put it back to review.
Comment 11 Gustavo Noronha (kov) 2009-03-16 23:06:30 PDT
(In reply to comment #10)
> (From update of attachment 28678 [details] [review])
> sorry, due mark's comments I put it back to review.
> 

I'm setting the review flag for duration to r+ again, after talking to Mark on IRC, and will add a FIXME comment pointing to a bug report in our bugzilla, refering to a bug on the gstreamer bugzilla.
Comment 12 Gustavo Noronha (kov) 2009-03-16 23:48:48 PDT
(In reply to comment #7)
> (From update of attachment 28680 [details] [review])
> What happens here if I explicitly hit "play" while a large video is buffering? 
> It seems like the video would pause itself until it completes loading, even
> though it may have buffered sufficiently for it to be watchable.  Does that
> match the spec?
> 
> What happens if I hit play and then explicitly pause the video while it is
> still loading?  It seems like the video would start itself playing when it
> finishes loading.  Does that match the spec?

I'll have to investigate this more closely. By reading the spec I believe we need to at least set readyState and networkState to specific values, and we need to figure out if we need to check if the user explicitely paused while we were buffering. I'll study some more tomorrow.
Comment 13 Gustavo Noronha (kov) 2009-03-17 00:04:16 PDT
Comment on attachment 28678 [details]
fix for duration

Landed as r41756, with comments addressed. Clearing review flag.
Comment 14 Gustavo Noronha (kov) 2009-03-17 00:11:50 PDT
Comment on attachment 28679 [details]
fix repainting

Landed as r41757. Clearing review flag.
Comment 15 Gustavo Noronha (kov) 2009-03-17 00:26:26 PDT
Comment on attachment 28681 [details]
enable passing tests

Landed as r41758. Clearing review flag.
Comment 16 Gustavo Noronha (kov) 2009-03-23 08:07:50 PDT
Comment on attachment 28680 [details]
fix buffering

Forgot to clear review flag while I stufy html5 media stuff a bit more for this change.
Comment 17 Gustavo Noronha (kov) 2009-04-22 19:11:04 PDT
*** Bug 16985 has been marked as a duplicate of this bug. ***