|
internet.com
IT
Developer Internet News Small Business Personal Technology International Search internet.com Advertise Corporate Info Newsletters Tech Jobs E-mail Offers
Developer Channel
FlashKit.com
JavaScript.com JavaScriptSource Developer Jobs ScriptSearch StreamingMediaWorld Web Developer's Journal Web Developer's Virtual Library WebDeveloper.com Webreference Web Hosts XMLfiles.com
|
SYMM
JavaScript Control of RealPlayer (2)
RealPlayer Methods In JavaScript, methods allow you to do something to or with your objects. RealPlayer supports a variety of methods that can be called upon to do work in your JavaScript. Among numerous other options, these methods allow you to start and stop the player, select a point within a clip to play, and recover performance statistics. For my example today, I want to focus on two methods for controlling player playback: DoPlay() will start the clip playing in the RealPlayer. DoStop() will stop the clip playing in the RealPlayer. With these two methods, I have enough to make the player start and stop my presentation. Capturing Events ![]() or, in HTML as:
Now that I have buttons to click, I need to make make them active. I do this by adding an anchor to each:
If you are new to JavaScript, the code here might look a little intimidating. It is really not that hard. The "javascript:void(0)" value to the HREF attribute simply tells the browser to ignore that actual HREF value. I do not want to send our visitor to another Web page. I simply want to make use of the linking power of the browser to launch or stop my video clip when the visitor clicks the graphic. I do just that with the OnClick event. The instructions "document.libertyclip.DoPlay()" is the RealPlayer method being told to do its thing within the Web page document on the EMBED source named "libertyclip.". Now that we have the pieces in place, it is time to test it all out.
The Latest WebDev Tips from DevX
Receive news via our XML/RSS feed |
|||||
|