onmediacomplete Event

This topic documents a feature of HTML+TIME 2.0, which is obsolete as of Windows Internet Explorer 9.

Fires when the element's associated media finish loading.

Fires when the element's associated media finish loading.


Inline HTML <ELEMENT onmediacomplete = "handler(event);" >
Event Propertyobject.onmediacomplete = handler;
attachEventobject.attachEvent( "onmediacomplete", handler);Internet Explorer only
Named script <SCRIPT FOR = object EVENT = onmediacomplete> Internet Explorer only

Event Information

To invoke Open a page in the browser that contains a media file affected by HTML+TIME.
Default action Calls the associated event handler.

Event Object Properties

Although event handlers in the DHTML Object Model do not receive parameters directly, a handler can query the event object for the following event properties.

Available Properties

srcElement Gets or sets the object that fired the event.
type Gets or sets the event name from the event object.

Refer to the specific event object for additional event properties.


When a streaming media file is used, this event could fire before the file starts playing.


This example demonstrates the onmediacomplete event. When the media element finishes loading, the onmediacomplete event fires and updates the status.

<HTML XMLNS:t ="urn:schemas-microsoft-com:time">
<TITLE>onmediacomplete Event</TITLE>
<?IMPORT namespace="t" implementation="#default#time2">

    .time {behavior: url(#default#time2);}

    LINK="#000000" VLINK="#808080" ALINK="#000000">

<t:video id="m1" src="/workshop/samples/author/behaviors/media/shuttle3.wmv"
	onmediacomplete="s1.innerText +=' Media Loaded'"/>

<SPAN id="s1">Status:</SPAN>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/onmediacomplete.htm

Applies To

t:ANIMATION, t:AUDIO, t:IMG, t:MEDIA, t:PAR, t:REF, t:SEQ, time2, t:VIDEO

See Also

Introduction to HTML+TIME

Community Additions