[webkit-help] Getting at the QTMovie * backing a <video> tag in Mac-based code?

Dan Wood dw43031apple at karelia.com
Tue Aug 31 15:15:21 PDT 2010


In our Mac-based website building app, Sandvox, I am trying to come up with a way to get at some properties of a movie which I am loading with a <video> tag.

What I have been doing so far is populating <video> with the source of the movie to show in the webview, and then *concurrently* creating a QTMovie object that I start loading so I can, for instance, generate a poster image for it (by getting the poster frame, or if it not set, some frame a little way into the movie).  

Though this approach is OK, it's not ideal ... when I specify a source video from a remote URL, this means that (as far as I can tell) the movie data is being loaded twice, in parallel .... slowing down the process.  A <video> tag has its own QTMovie  reference behind the scenes (from what I can tell looking at WebKit source), and there is my QTMovie as well -- both sucking up network bandwidth.  (Well, unless I prevent preloading of the <video> tag.)

What if there were some way to get at the underlying QTMovie object used by the <video> tag, so that I could perform my QTMovie operations, and not have to have the movie be loaded separately?

If I could do this, then theoretically I could also do something nice like get the current frame, so I could have an interface to set my poster frame to the currently displayed frame in the <video>.  (I know that I can get to the current time in the movie using the currentTime attribute, but actually getting the frame image data would require going into the underlying QuickTime movie.  Or, I'd have to get the code from my "other" QTMovie object, which might still be loading...)

Can anybody help me figure out a trick to get at the underlying QTMovie data of a <video> tag so that I can accomplish this stuff?  This is only from a Mac client, so I can safely assume it's a QTMovie in the background....

Thanks....

--
Dan Wood
Twitter: http://twitter.com/danwood
Karelia Software — Sandvox for the Mac
http://www.karelia.com/

"Those who can make you believe absurdities can make you commit atrocities."
Voltaire

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100831/6da469c8/attachment.html>


More information about the webkit-help mailing list