NEW 37034
[GStreamer] Player doesn't return to NETWORK_IDLE when not using network
https://bugs.webkit.org/show_bug.cgi?id=37034
Summary [GStreamer] Player doesn't return to NETWORK_IDLE when not using network
Andrew Scherkus
Reported 2010-04-02 11:49:42 PDT
In order to implement the suspend event, MediaPlayerPrivate implementations should return to NETWORK_IDLE when not using the network.
Attachments
proposed patch (2.25 KB, patch)
2011-03-14 10:05 PDT, Philippe Normand
no flags
Philippe Normand
Comment 1 2010-07-22 04:01:34 PDT
I don't see NETWORK_LOADED in the spec anymore while we still use it. http://www.w3.org/TR/html5/video.html#dom-media-networkstate Should we replace Loaded with Idle?
Philippe Normand
Comment 2 2010-07-22 04:02:51 PDT
BTW the test to fix/unskip is http/tests/media/video-play-suspend.html
Philippe Normand
Comment 3 2010-07-22 05:10:13 PDT
LOADED is used when a media is fully buffered I think and IDLE is when network is not used, so I guess it's kind of not the same ;) I'm still confused though to still see we use LOADED and the spec not mentionning it anymore, or I'm reading the wrong one.
Eric Carlson
Comment 4 2010-07-22 07:31:00 PDT
(In reply to comment #1) > I don't see NETWORK_LOADED in the spec anymore while we still use it. > > http://www.w3.org/TR/html5/video.html#dom-media-networkstate > NETWORK_LOADING and the 'loaded' event went away in r63684 (and a few follow-on build fixes ;-). (In reply to comment #3) > LOADED is used when a media is fully buffered I think > and IDLE is when network is not used, so I guess it's kind of not the same ;) > > I'm still confused though to still see we use LOADED and the spec not mentionning it > anymore, or I'm reading the wrong one. We still have the internal state MediaPlayer::Loaded, but that translates to networkState == NETWORK_IDLE. This internal state is necessary so we can tell if we need to fire the 'suspend' event or not. The spec says this about the 'suspend' event: The user agent is intentionally not currently fetching media data, but does not have the entire media resource downloaded. http://www.w3.org/TR/html5/video.html#mediaevents The 'suspend' event is only fired when the media engine sets networkState to MediaPlayer::Idle itself.
Philippe Normand
Comment 5 2010-07-23 05:53:46 PDT
(In reply to comment #4) > (In reply to comment #3) > > LOADED is used when a media is fully buffered I think > > and IDLE is when network is not used, so I guess it's kind of not the same ;) > > > > I'm still confused though to still see we use LOADED and the spec not mentionning it > > anymore, or I'm reading the wrong one. > We still have the internal state MediaPlayer::Loaded, but that translates to networkState == NETWORK_IDLE. This internal state is necessary so we can tell if we need to fire the 'suspend' event or not. The spec says this about the 'suspend' event: > > The user agent is intentionally not currently fetching media data, but does not have the entire media resource downloaded. > > http://www.w3.org/TR/html5/video.html#mediaevents > > The 'suspend' event is only fired when the media engine sets networkState to MediaPlayer::Idle itself. Hum does that mean we should set networkState to Idle when the media is fully loaded? Sorry but I don't see how to make that test pass without doing that, simply because the media is local, download is instantaneous, so I don't see why a suspend event should be fired in this case. In progressive download mode GStreamer will keep the download running even if the playback is paused, until it fully completes, AFAIK.
Steve Lacey
Comment 6 2011-03-01 12:45:10 PST
FYI, http/tests/media/video-play-suspend.html has been removed as the test isn't actually valid according to spec. See https://bugs.webkit.org/show_bug.cgi?id=55198 for details.
Philippe Normand
Comment 7 2011-03-02 00:31:38 PST
Thanks for the heads up Steve! Seems like this new test is passing on GTK. Does this mean we can close this bug?
Steve Lacey
Comment 8 2011-03-02 13:05:58 PST
You need to make sure you set the network state to loaded before transitioning to the final idle so that a final progress event is fired (see HTMLMediaElement.cpp). If you're doing this, all should be good.
Philippe Normand
Comment 9 2011-03-14 10:05:47 PDT
Created attachment 85687 [details] proposed patch
Martin Robinson
Comment 10 2011-03-14 10:06:57 PDT
Comment on attachment 85687 [details] proposed patch Are there any tests covering this?
Philippe Normand
Comment 11 2011-03-14 10:23:46 PDT
(In reply to comment #10) > (From update of attachment 85687 [details]) > Are there any tests covering this? Hum it doesn't seem so. I'll try to write one :) Will clear the r+ flag for now.
Martin Robinson
Comment 12 2013-02-08 10:35:45 PST
If writing a test is a lot of work, it's probably okay just to land this as-is.
Xabier Rodríguez Calvar
Comment 13 2021-04-14 06:36:15 PDT
There is a http/tests/media/video-load-suspend.html test and it seems to check out now. I think we can close this.
Note You need to log in before you can comment on or make changes to this bug.