HBCMS更多的中文手册参考:

onplaystatechange Event

DHTML文档教程

Fires when the Media Bar player changes its play state.

dhtml语法

Event propertymediaBar.onplaystatechange = handlerJScript only
mediaBar.onplaystatechange = GetRef("handler")Visual Basic Scripting Edition (VBScript) 5.0 or later only
Named script <SCRIPT FOR = mediaBar EVENT = onplaystatechange> Internet Explorer only

Event Information

BubblesNo
CancelsNo
To invoke
  • Attempt to play media content in the media player.
  • Scan forward or backward in the currently playing media content.
  • Pause or stop the currently playing media content.
Default action Initiates any action associated with this script.

Available Properties

Available Properties

remarks

the media bar player's play state changes as it begins, pauses, or stops media playback, scans a stream forward or backward, and buffers or waits for streaming data. to handle events related to locating and opening media items, use onopenstatechange.

if multiple instances of the mediabar behavior run concurrently, only one of them receives event notification, even though all instances have access to media item attributes and information about the open and play states. developers are encouraged to avoid designs that employ multiple instances of the behavior.

although the event object is theoretically available in event notifications from onopenstatechange and onplaystatechange, it does not contain or provide useful information if queried. instead, event handlers should query the openstate and playstate properties to return player state information.

DHTML代码范例

In the following example, HTML in the Media Bar content area is updated with the media's play state information when the onplaystatechange event fires. Because the openState and playState properties return an integer, the function in this example accesses an array in order to return a text description. The array is not shown on this page, but you can see it by clicking the Show Me sample and viewing the source code.

<SCRIPT>
.
.
.
function play_state_handle() {
// Return the play state as integer and access the array to return the text associated
// with that integer
div_Playstate.innerText += divMedia.playState + '  ' + play_array[divMedia.playState]
+ '<BR>'
}
.
.
.
</SCRIPT>
<BODY>
<!-- In the Media Bar content area, the play state description text appears in divMedia. -->
<DIV style="behavior:url(#default#mediaBar)" OnPlayStateChange="play_state_handle()"
id="divMedia"></DIV>
</BODY>
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

更多语法参考

playState