View Single Post
Old 06-23-2009, 03:54 PM   PM User | #16
piers
New Coder

 
Join Date: Jun 2009
Posts: 63
Thanks: 8
Thanked 0 Times in 0 Posts
piers is an unknown quantity at this point
Right, well :P....

If anyone's into a bit of a project...

I found this on the Apple dev website at http://developer.apple.com/documenta...1526-CH001-SW4

Quote:
The browser plug-ins for QuickTime 7.2.1 and later include the ability to emit Document Object Model (DOM) events. DOM events can be emitted when the plug-in is instantiated and ready to interact with JavaScript, at various points during a movie’s loading process, when playback has begun, paused, or ended, or in the event of an error. JavaScript functions can be set to "listen" for particular DOM events. Whenever the DOM event occurs, the listener function is called.

This allows you to create web pages that detect events such as movie loading, playing, pausing, or ending, without having to create JavaScript timing loops or constantly poll the plug-in for status. It also allows you to execute JavaScript functions in response to various movie events without sending javascript:// URLs from a movie.
Two of the DOM events emitted by the QT plugin are:
Quote:
qt_loadedmetadata — The movie header information has been loaded or created. The duration, dimensions, looping state, and so on are now known.

qt_load — All media data has been loaded.
Therefore by registering an event listener:

Code:
<script language="javascript" type="text/javascript">
function myAddListener(obj, evt, handler, captures)
    {
        if ( document.addEventListener )
            obj.addEventListener(evt, handler, captures);
        else
            // IE
            obj.attachEvent('on' + evt, handler);
    }
</script>
and writing a function that uses the
Code:
string GetUserData('©nam')
method, (Which returns the movie's name from the user data), it should be possible to write a piece of code that listens for the new movie loading and then returns that movies name, right?

'Cept, of course, that I'm clueless about how to do that
piers is offline   Reply With Quote