[webkit-gtk] video tag loop attribute

Christian Betz cbetz at sicom.com
Thu Jun 2 15:08:07 PDT 2011


Hi.

I am working on a webkit-gtk based project that makes use of the
<video> element. It works great for the most part, but I have found
that the video does not loop if the loop attribute is used. (The loop
attribute works fine in chrome) Also, this seems to only affect some
videos:

 http://sicom.com/~cbetz/videotag.html  -- does not loop using an
official theora example video (http://wiki.xiph.org/TheoraTestsuite)
 http://sicom.com/~cbetz/videotag_works.html  -- does loop using
random video from wikipedia

I'm not sure yet if this is a webcore, webkit gtk, or gstreamer issue,
but I'm interested in fixing it. This my first foray into webkit
development. Can anyone point me in the right direction?

I determined that the loop attribute *is* at least getting picked up
in Source/WebCore/html/HTMLMediaElement.cpp. The problem *appears* to
be with the seeking back to the beginning that should occur after the
first run of the video has played. Here is the debug output starting
when the browser first loads the page with the video tag.

(I am using WebKit-r87124. With WEBKIT_DEBUG set to "Media")

HTMLMediaElement::HTMLMediaElement
HTMLMediaElement::scheduleLoad
HTMLMediaElement::prepareForLoad
HTMLMediaElement::cancelPendingEventsAndCallbacks
HTMLMediaElement::setPlaybackRate(1.000000)
HTMLMediaElement::setShouldDelayLoadEvent(true)
HTMLMediaElement::removedFromDocument
HTMLMediaElement::selectMediaResource
HTMLMediaElement::loadResource(http://cbetz.staff/projects/dmb/thor.ogv, )
HTMLMediaElement::loadResource - m_currentSrc ->
http://cbetz.staff/projects/dmb/thor.ogv
HTMLMediaElement::mediaPlayerEngineUpdated
HTMLMediaElement::selectMediaResource, 'src' not used
HTMLMediaElement::mediaPlayerEngineUpdated
HTMLMediaElement::mediaPlayerEngineUpdated
HTMLMediaElement::setNetworkState(2) - current state is 2
HTMLMediaElement::setReadyState(2) - current state is 0,
HTMLMediaElement::setShouldDelayLoadEvent(false)
HTMLMediaElement::updatePlayState - shouldBePlaying = false, playerPaused = true
HTMLMediaElement::setReadyState(4) - current state is 2,
HTMLMediaElement::invalidateCachedTime
HTMLMediaElement::updatePlayState - shouldBePlaying = true, playerPaused = true
HTMLMediaElement::invalidateCachedTime
HTMLMediaElement::mediaPlayerMuteChanged
HTMLMediaElement::setMuted(false)
HTMLMediaElement::setNetworkState(3) - current state is 2

... then the video stops playing ....

HTMLMediaElement::mediaPlayerDurationChanged
HTMLMediaElement::mediaPlayerCharacteristicChanged
HTMLMediaElement::mediaPlayerTimeChanged
HTMLMediaElement::invalidateCachedTime
HTMLMediaElement::seek(0.000000)
HTMLMediaElement::addPlayedRange(0.000000, 13.000000)
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::updatePlayState - shouldBePlaying = true, playerPaused = false
HTMLMediaElement::invalidateCachedTime
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
HTMLMediaElement::currentTime - seeking, returning 0.000000
..


The last message continues repeating ever second or so until the
browser is closed.

If you made it this far, thanks for looking!

Christian


More information about the webkit-gtk mailing list