-->

The Windows Media ActiveX Control – Not Just for Internet Explorer Anymore

Callbacks
Callbacks are events generated by the Windows Media Player that are meant to trigger some event in the Web browser. They are initiated by the player itself when something changes (play, pause, stop, user mouse clicks, playback errors, etc); or by script events embedded directly in the Windows Media stream (such as slide changes or closed-captioning). Internet Explorer has its own non-standard Javascript syntax for capturing these events so you can handle them in your page, and Mozilla now supports it, too. This code will detect changes in the state of the WMP Player as it plays:

<script for="MyWMPlayer" event="PlayStateChange(state)"> switch (state){ case 1: alert("Stopped"); break; case 2: alert("Paused"); break; case 3: alert("Playing"); break; // etc for other cases: // 4=Scan Forward, 5=Scan Back, 6=Buffering, 7=Waiting // 8=Media Ended, 9=Transitioning, 10=Ready, 11=Reconnecting } </script>Conclusion
It's easier than ever to make Web pages work beautifully on all modern browsers – typically only novice developers create IE-only Web pages. Coding to standards is just plain smart, as well as being good for our industry. Don't forget - our industry literally exists because of the open standards upon which the Web was built.

Even if you stick to standards, with Windows Media player it's not easy to support embedding for all the various browsers and platforms. And it's not just Windows Media -- Quicktime and RealPlayer both have better support for varied environments, but there are still differences in how things behave on different platforms.

Mozilla's ActiveX support is one great step in the right direction for making developers' lives easier, and making users' experiences smoother while preserving choice.

References
Netscape's DevEdge WMP Reference
Mozilla Home Page
Mozilla ActiveX Plugin Installers
Microsoft's WM9 SDK Download Page
Some of Mozilla's wealth of features that Web developers and consumer users find indispensable.

Streaming Covers
Free
for qualified subscribers
Subscribe Now Current Issue Past Issues