呀,回复急了点,这个事件应该更好点: PlayStateChange对于playState,取值情况如下: Value State Description 0 Undefined Windows Media Player is in an undefined state. 1 Stopped Playback of the current media item is stopped. 2 Paused Playback of the current media item is paused. When a media item is paused, resuming playback begins from the same location. 3 Playing The current media item is playing. 4 ScanForward The current media item is fast forwarding. 5 ScanReverse The current media item is fast rewinding. 6 Buffering The current media item is getting additional data from the server. 7 Waiting Connection is established, but the server is not sending data. Waiting for session to begin. 8 MediaEnded Media item has completed playback. 9 Transitioning Preparing new media item. 10 Ready Ready to begin playing. 11 Reconnecting Reconnecting to stream
<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>
PlayStateChange对于playState,取值情况如下:
Value State Description
0 Undefined Windows Media Player is in an undefined state.
1 Stopped Playback of the current media item is stopped.
2 Paused Playback of the current media item is paused. When a media item is paused, resuming playback begins from the same location.
3 Playing The current media item is playing.
4 ScanForward The current media item is fast forwarding.
5 ScanReverse The current media item is fast rewinding.
6 Buffering The current media item is getting additional data from the server.
7 Waiting Connection is established, but the server is not sending data. Waiting for session to begin.
8 MediaEnded Media item has completed playback.
9 Transitioning Preparing new media item.
10 Ready Ready to begin playing.
11 Reconnecting Reconnecting to stream
.
.
.
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>