Share via


mediaBar Behavior

This topic documents a feature that is obsolete as of Windows Internet Explorer 7.

Obsolete. Provides a basic UI for locating and playing media within the browser window. The Media Bar default behavior exposes much of the Media Bar functionality to scripting, giving you control over playback, navigation, and the player UI. It also enables you to load HTML in the Media Bar content area.

Syntax

XML
		<Prefix:

CustomTag ID=sID STYLE="behavior:url('#default#mediaBar')" />

HTML <ELEMENT STYLE="behavior:url('#default#mediaBar')" ID=sID>
Scripting object.style.behavior = "url('#default#mediaBar')"
object.addBehavior ("#default#mediaBar")

Possible Values

Prefix Prefix that associates the CustomTag with an XML namespace. This prefix is set using the XMLNS attribute of the HTML tag.
CustomTag User-defined tag.
sID String that specifies a unique identifier for the object.

Members Table

The following table lists the members exposed by the mediaBar object.

Property Description
currentItem

Obsolete. Retrieves the current media item.

disabledUI

Obsolete. Sets or retrieves a Boolean value that specifies whether an instance of the Media BarUI is disabled.

enabled

Obsolete. Sets or retrieves a Boolean value that specifies whether the Media Bar player control is enabled.

hasNextItem

Obsolete. Retrieves a value that indicates whether any successive items follow the current item in the playlist.

nextItem

Obsolete. Retrieves the next media item in a playlist, if there is one.

openState

Obsolete. Retrieves an integer that indicates the open state of the Media Bar player.

playlistInfo

Obsolete. Retrieves playlist information, if a playlist exists.

playState

Obsolete. Retrieves an integer that indicates the play state of the Media Bar player.

Event Property Description
onhide

Obsolete. Fires when the Media Bar player is hidden.

onopenstatechange

Obsolete. Fires when the Media Bar player changes its open state.

onplaystatechange

Obsolete. Fires when the Media Bar player changes its play state.

onshow

Obsolete. Fires when the Media Bar player becomes visible.

Method Description
playNext

Obsolete. Starts playback of the next media item in the playlist, if a playlist is present.

playURL

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

stop

Obsolete. Stops playback of the media that is currently playing.

Object Description
MediaItem

Obsolete. Represents a single item in a media player playlist.

PlaylistInfo

Obsolete. Contains information about a media player playlist.

Remarks

As of Microsoft Internet Explorer 6 on Windows XP Service Pack 2 (SP2) or Internet Explorer 7, the mediaBar feature is obsolete and no longer available.

mediaBar was introduced in Internet Explorer 6

Users can open the Media Bar by clicking a media link in the browser, typing the URL of a media file in the address bar, clicking the Media button in the Internet Explorer toolbar, or by choosing Explorer Bar from the View menu and selecting Media . The mediaBar behavior only functions within the Media Bar.

When new content is targeted at the mediaBar behavior, the Media Bar becomes dedicated to that content, stopping playback of previous media and navigating away from HTML in the Media Bar content area. For a demonstration, see the example section that follows.

You might not have access to the members listed in this table using script until the window. onload event fires. If you wait for this event to fire, it ensures that the page is completely loaded, that all behaviors have been applied to corresponding elements on the page, and that all the behavior's properties, methods, and events are available for scripting. If you use any of the behavior-defined members before the window. onload event fires, a scripting error can occur, which indicates that the object does not support that particular member.

Security Alert  The Media Bar can load .asx and .asf files that specify multiple media URLs and scripted content. For security reasons, streamed content from unverified sources should be treated as user input. Developers should use caution when displaying content from unverified sources as HTML in the Media Bar content pane. For more information, see Security Considerations: Dynamic HTML and Security Considerations: DHTML and Default Behaviors.

The mediaBar behavior is available in Internet Explorer 6 only in the Microsoft Win32 platform.

Examples

The following example shows an ordinary link to media content. When clicked, it starts media playback in the Media Bar.

<A href="https://msdn.microsoft.com/workshop/samples/author/behaviors/
media/56movie.asf">
      Launch the shuttle.</A>

To display HTML content in the Media Bar content area, you can use a link that targets the Media Bar.

<A target="_media"
 href="https://msdn.microsoft.com/workshop/samples/author/behaviors/
 sample_content.htm"></A>

Because the behavior works only within the Media Bar, you must load any HTML content that uses the mediaBar behavior in the Media Bar content area and declare the behavior there. Playback of media files loaded with the mediaBar behavior's playNext or playURL methods can then be paused, scanned, and stopped using the media player user interface.

<!-- Use an inline behavior declaration for media content in the Media Bar content area. -->

<DIV style="behavior:url(#default#mediaBar)" id="divMedia">
    Container for media to play in the Media Bar.
</DIV>

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

See Also

Using the Media Bar in Internet Explorer