Home | Index

Yahoo! Music API Guide

Video Player Events

To use these events, be sure to specify a callback handler through the "eh" parameter: so.addVariable('eh', 'myCallbackEventHandler');

The callback handler must take two parameters, first is the event type (pType) and the second is an information object about that event (pItem):

Example Callback Function

y_up_eventHandler = function( pType, pItem ) {

  switch (pType){
        case "init":            // thrown when the player has been initialized and the flash external API is ready to be accessed
        case "itemBegin":       // thrown when a video starts playing for the first time
        case "itemEnd":         // thrown when a video has played for its total duration
        case "done":            // thrown when all videos have played


        case "streamPlay":      // thrown anytime a video begins to play
        case "streamPause":     // thrown when vidPause() is requested and completed
        case "streamStop":      // thrown when playback has stopped for whatever reason (not the same as itemEnd)
        case "streamError":     // thrown when an error occurs with the stream
        case "userClick":       // thrown when a user click on clicks on playback compoents w/i the post panel
            break;
    }
}