Click to return to the Streaming     
Web Workshop  |  Streaming & Interactive Media

TIMEMediaPlayerEvents


TIMEMediaPlayerEvents is a dispinterface that enables a media player to generate events for use within HTML+TIME. These events are used in HTML+TIME Web pages for handshaking and to account for latencies and asynchronous tasks in the player.

The HTML+TIME media element (video or audio) implements the TIMEMediaPlayerEvents methods. The media player in the HTML+TIME Web page signals events to the HTML+TIME media elements. In the following HTML+TIME code, t:VIDEO defines the media element and GUID_PLAYER defines the GUID of the media player.

<t:VIDEO 
    STYLE="behavior:url(#DEFAULT#TIME)" 
    t:BEGIN="5" 
    t:SRC="http://example.microsoft.com/vidfile1.avi" 
    t:PLAYER="GUID_PLAYER"
/>

The media player signals events to the Web page by using TIMEMediaPlayerEvents methods accessed through the HTML+TIME media element's IDispatch interface. The TIMEMediaPlayerEvents methods are assigned DISPIDs (dispatch identifiers), and each is associated with an HTML+TIME event. To signal an event, the player sends the appropriate DISPID to the media element by calling the IDispatch::Invoke or DispInvoke method on the media element's IDispatch interface. For more information, see Accessing an Object Through the IDispatch Interface in the COM and ActiveX Object Services section of the Platform SDK.

TIMEMediaPlayerEvent Methods

onbegin

DescriptionGenerates an event when the media begins playing.
DISPIDDISPID_TIMEMEDIAPLAYEREVENTS_ONBEGIN
HTML+TIME Eventonbegin

onend

DescriptionGenerates an event when the media stops playing.
DISPIDDISPID_TIMEMEDIAPLAYEREVENTS_ONEND
HTML+TIME Eventonend

onmedialoadfailed

DescriptionGenerates an event if the media source fails to load. This can be caused by an invalid path or a corrupt file.
DISPIDDISPID_TIMEMEDIAPLAYEREVENTS_ONMEDIALOADFAILED
HTML+TIME Eventonmedialoadfailed

onmediaready

DescriptionGenerates an event when the media source is ready to play.
DISPIDDISPID_TIMEMEDIAPLAYEREVENTS_ONMEDIAREADY
HTML+TIME Eventonmediacomplete

onmediaslip

DescriptionGenerates an event when the connection to the media source is lost or dropped.
DISPIDDISPID_TIMEMEDIAPLAYEREVENTS_ONMEDIASLIP
HTML+TIME Eventonmediaslip

onpause

DescriptionGenerates an event when the player pauses.
DISPIDDISPID_TIMEMEDIAPLAYEREVENTS_ONPAUSE
HTML+TIME Eventonpause

onresume

DescriptionGenerates an event when the player resumes playing after a pause.
DISPIDDISPID_TIMEMEDIAPLAYEREVENTS_ONRESUME
HTML+TIME Eventonresume


Back to topBack to top

Did you find this article useful? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.