Contents Index Topic Contents | |
Previous Topic: Invoking Methods Next Topic: Handling Events |
Accessing Properties
Accessing and modifying the properties of the Microsoft® Windows Media™ Player control requires somewhat different scripting syntax for Netscape Navigator and Microsoft® Internet Explorer. For example, to retrieve and set the FileName property from Netscape Navigator, use the following:
MediaPlayer.SetFileName("demo.asf"); var myTitle = MediaPlayer.GetFileName();The corresponding statements in Internet Explorer are as follows:
MediaPlayer.FileName = "demo.asf" var myTitle = MediaPlayer.FileNameTo write a script that works under both browsers, check the browser type before accessing the properties. The following code segment shows how to turn on captioning for either Netscape Navigator or Internet Explorer.
if (navigator.appName = "Navigator") { MediaPlayer.SetShowCaptioning(true); } else { MediaPlayer.ShowCaptioning = true; }
Top of Page
© 1999 Microsoft and/or its suppliers. All rights reserved. Terms of Use.