共用方式為


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.

Syntax

Inline HTML <ELEMENT onmediacomplete = "handler(event);" >
Event Property object.onmediacomplete = handler;
attachEvent object.attachEvent( "onmediacomplete", handler);
Named script <SCRIPT FOR = object EVENT = onmediacomplete>

Event Information

Bubbles No
Cancels No
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.

Remarks

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

Example

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">
<HEAD>
<TITLE>onmediacomplete Event</TITLE>
<?IMPORT namespace="t" implementation="#default#time2">

<STYLE>
    .time {behavior: url(#default#time2);}
</STYLE>
</HEAD>

<BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
    LINK="#000000" VLINK="#808080" ALINK="#000000">

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

<BR><BR>
<SPAN id="s1">Status:</SPAN>
</BODY>
</HTML>

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