<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>37034</bug_id>
          
          <creation_ts>2010-04-02 11:49:42 -0700</creation_ts>
          <short_desc>[GStreamer] Player doesn&apos;t return to NETWORK_IDLE when not using network</short_desc>
          <delta_ts>2021-04-14 06:36:15 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrew Scherkus">scherkus</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>calvaris</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>mrobinson</cc>
    
    <cc>pnormand</cc>
    
    <cc>sjl</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>207976</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Scherkus">scherkus</who>
    <bug_when>2010-04-02 11:49:42 -0700</bug_when>
    <thetext>In order to implement the suspend event, MediaPlayerPrivate implementations should return to NETWORK_IDLE when not using the network.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>254718</commentid>
    <comment_count>1</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2010-07-22 04:01:34 -0700</bug_when>
    <thetext>I don&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>254719</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2010-07-22 04:02:51 -0700</bug_when>
    <thetext>BTW the test to fix/unskip is http/tests/media/video-play-suspend.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>254736</commentid>
    <comment_count>3</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2010-07-22 05:10:13 -0700</bug_when>
    <thetext>LOADED is used when a media is fully buffered I think
and IDLE is when network is not used, so I guess it&apos;s kind of not the same ;)

I&apos;m still confused though to still see we use LOADED and the spec not mentionning it anymore, or I&apos;m reading the wrong one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>254777</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2010-07-22 07:31:00 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; I don&apos;t see NETWORK_LOADED in the spec anymore while we still use it.
&gt; 
&gt; http://www.w3.org/TR/html5/video.html#dom-media-networkstate
&gt; 
NETWORK_LOADING and the &apos;loaded&apos; event went away in r63684 (and a few follow-on build fixes ;-).


(In reply to comment #3)
&gt; LOADED is used when a media is fully buffered I think
&gt; and IDLE is when network is not used, so I guess it&apos;s kind of not the same ;)
&gt; 
&gt; I&apos;m still confused though to still see we use LOADED and the spec not mentionning it 
&gt; anymore, or I&apos;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 &apos;suspend&apos; event or not. The spec says this about the &apos;suspend&apos; 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 &apos;suspend&apos; event is only fired when the media engine sets networkState to MediaPlayer::Idle itself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>255337</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2010-07-23 05:53:46 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; LOADED is used when a media is fully buffered I think
&gt; &gt; and IDLE is when network is not used, so I guess it&apos;s kind of not the same ;)
&gt; &gt; 
&gt; &gt; I&apos;m still confused though to still see we use LOADED and the spec not mentionning it 
&gt; &gt; anymore, or I&apos;m reading the wrong one.
&gt; 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 &apos;suspend&apos; event or not. The spec says this about the &apos;suspend&apos; event:
&gt; 
&gt; The user agent is intentionally not currently fetching media data, but does not have the entire media resource downloaded.
&gt; 
&gt; http://www.w3.org/TR/html5/video.html#mediaevents
&gt; 
&gt; The &apos;suspend&apos; 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&apos;t see how to make that test pass without doing that, simply because the media is local, download is instantaneous, so I don&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>360129</commentid>
    <comment_count>6</comment_count>
    <who name="Steve Lacey">sjl</who>
    <bug_when>2011-03-01 12:45:10 -0800</bug_when>
    <thetext>FYI, http/tests/media/video-play-suspend.html has been removed as the test isn&apos;t actually valid according to spec. See https://bugs.webkit.org/show_bug.cgi?id=55198 for details.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>360639</commentid>
    <comment_count>7</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2011-03-02 00:31:38 -0800</bug_when>
    <thetext>Thanks for the heads up Steve! Seems like this new test is passing on GTK. Does this mean we can close this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361017</commentid>
    <comment_count>8</comment_count>
    <who name="Steve Lacey">sjl</who>
    <bug_when>2011-03-02 13:05:58 -0800</bug_when>
    <thetext>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&apos;re doing this, all should be good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>367036</commentid>
    <comment_count>9</comment_count>
      <attachid>85687</attachid>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2011-03-14 10:05:47 -0700</bug_when>
    <thetext>Created attachment 85687
proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>367038</commentid>
    <comment_count>10</comment_count>
      <attachid>85687</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2011-03-14 10:06:57 -0700</bug_when>
    <thetext>Comment on attachment 85687
proposed patch

Are there any tests covering this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>367044</commentid>
    <comment_count>11</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2011-03-14 10:23:46 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; (From update of attachment 85687 [details])
&gt; Are there any tests covering this?

Hum it doesn&apos;t seem so. I&apos;ll try to write one :) Will clear the r+ flag for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>828669</commentid>
    <comment_count>12</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2013-02-08 10:35:45 -0800</bug_when>
    <thetext>If writing a test is a lot of work, it&apos;s probably okay just to land this as-is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1750090</commentid>
    <comment_count>13</comment_count>
    <who name="Xabier Rodríguez Calvar">calvaris</who>
    <bug_when>2021-04-14 06:36:15 -0700</bug_when>
    <thetext>There is a http/tests/media/video-load-suspend.html test and it seems to check out now. I think we can close this.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>85687</attachid>
            <date>2011-03-14 10:05:47 -0700</date>
            <delta_ts>2011-03-14 10:23:59 -0700</delta_ts>
            <desc>proposed patch</desc>
            <filename>proposed-patch.patch</filename>
            <type>text/plain</type>
            <size>2299</size>
            <attacher name="Philippe Normand">pnormand</attacher>
            
              <data encoding="base64">RnJvbSAxMTkzMmU0ZWY1MWFhOGFhNGJmZDE5MWZkZTcwMGVlYjM2ZTJmYzM3IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwZSBOb3JtYW5kIDxwbm9ybWFuZEBpZ2FsaWEuY29t
PgpEYXRlOiBNb24sIDE0IE1hciAyMDExIDE4OjA3OjA0ICswMTAwClN1YmplY3Q6IFtQQVRDSF0g
cHJvcG9zZWQgcGF0Y2gKCi0tLQogU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nICAgICAgICAgICAg
ICAgICAgICAgICAgICAgfCAgIDE0ICsrKysrKysrKysrKysrCiAuLi4vZ3N0cmVhbWVyL01lZGlh
UGxheWVyUHJpdmF0ZUdTdHJlYW1lci5jcHAgICAgICB8ICAgIDggKysrKysrKysKIDIgZmlsZXMg
Y2hhbmdlZCwgMjIgaW5zZXJ0aW9ucygrKSwgMCBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9T
b3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
YzgxNzA1MS4uY2ZkMWQwYiAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisr
KyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE3IEBACisyMDExLTAzLTE0
ICBQaGlsaXBwZSBOb3JtYW5kICA8cG5vcm1hbmRAaWdhbGlhLmNvbT4KKworICAgICAgICBSZXZp
ZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBNZWRpYVBsYXllclByaXZhdGVHU3Ry
ZWFtZXIgZG9lc24ndCByZXR1cm4gdG8gTkVUV09SS19JRExFIHdoZ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