Contents Index Topic Contents | |
Previous Topic: Capturing Keyboard and Mouse Events Next Topic: Error Handling |
Monitoring Stream Status and Network Reception
The Microsoft® Windows Media™ Player control can provide you with advanced information about the performance of the media playback. Some of this information can be used for proper operation of the Windows Media Player in scripts, while other information allows you to monitor the network reception rates for the media file.
For example, when creating a script to operate the "Play" function of the Windows Media Player, you would want to use the PlayState property to determine whether the Windows Media Player was already playing a media file. The example that follows shows a script that starts the Windows Media Player only if it is not currently playing a file (PlayState=2).
<SCRIPT> function onPlay() { if(MediaPlayer.PlayState!=2) MediaPlayer.Play(); } </SCRIPT>You could also notify users of any buffering that the Windows Media Player is doing with the current file, updating the buffering progress on the web page while they are waiting for the playback to begin.
Stream status properties include:
Supported events include:
- OpenStateChange (Occurs only when the SendOpenStateChangeEvents property is true.)
- PlayStateChange (Occurs only when the SendPlayStateChangeEvents property is true.)
- EndOfStream
- NewStream
Network reception properties include:
Attributes for monitoring buffering include:
- BufferingTime property
- BufferingCount property
- BufferingProgress property
- Buffering event
Top of Page
© 1999 Microsoft and/or its suppliers. All rights reserved. Terms of Use.