mediaWidth property

Gets the width of the element.

Syntax

JScript
width = object.mediaWidth

 

Property values

Type: Integer

the width of the element, in pixels.

Remarks

This property represents the actual width of the media file as stored. By default, the media element renders at the width specified in the media file.

Examples

This example uses the mediaWidth property to get the width of the media element.

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

<HTML XMLNS:t="urn:schemas-microsoft-com:time">
<HEAD>
<TITLE>mediawidth Property</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">
<B>Timer:</B>
<SPAN id="Timer" class="time" dur=".01" repeatCount="indefinite" fill="hold"
    onrepeat="innerText=parseInt(document.body.currTimeState.activeTime);">0
    </SPAN>
<BR><BR>

<t:video id="m1" src="/workshop/samples/author/behaviors/media/shuttle3.wmv"/>

<BR><BR>
<SPAN id="mediawidth1">Media width:</SPAN>

<BR><BR>
<BUTTON id="b1" onclick="mediawidth1.innerText='Media width: ' + 
    m1.mediawidth + ' pixels.'">Click here for the width of the media element
    </BUTTON>
</BODY>
</HTML>

See also

animation

audio

img

media

par

ref

seq

video

Reference

mediaHeight

Conceptual

Introduction to HTML+TIME