playURL

HTML (DHTML)

playURL Method

Internet Development Index

Loads media from a URL into the Media Bar and starts playback.

Syntax

mediaBar.playURL(sURL, sMIME)

Parameters

sURL Required. String that specifies the URL of the media to play.
sMIME Required. String that specifies the Multipurpose Internet Mail Extensions (MIME) type of the media to play. Cannot be NULL.

Return Value

No return value.

Remarks

You must specify the MIME type for sMIME . If the MIME type specified is invalid but not NULL, the openState property returns 21 ("The player is opening a URL whose type is not known") while Internet Explorer attempts to determine the media's MIME type. Internet Explorer can handle the media appropriately, even if the MIME type specified in sMIME is incorrect. However, if no MIME type is specified, the Media Bar does not play the media. For more information about MIME types, see MIME Types in IIS.

You must also specify an absolute http, https, or ftp address for the media with sURL . Unlike the HTML page loaded in the media pane, the media player itself cannot serve as a reference point to a particular domain for uplevel or downlevel directories. Therefore, specify an absolute URL in calls to playURL.

If no media is currently playing in the Media Bar, any attempt to access media attribute information with getItemInfo, getAttributeName, or attributeCount returns a script error.

Example

In the following example, a button loaded in the Media Bar content area starts playback of an ASX file.

<INPUT type=button onclick="divMedia.playURL(
'http://msdn.microsoft.com/workshop/samples/author/behaviors/media/mediabar_1.asx',
'video/x-ms-asf');" value='Play the ASX file'/>
This feature requires Microsoft® Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Applies To

mediaBar