Javascript and Browser Plugins
Javascript and Browser Plugins
Plugin Generalities
What is a plugin ?
There are lots of browser plugins for almost any kind of application: Adobe Flash, Java Applets, QuickTime, Windows Media Player, Adobe Acrobat, Silverlight about:plugins and Manage Add-ons
Plugin Usage
InternetExplorer and ActiveXObject: type vs. classid Object tag attributes: type, data, codebase, classid,
codetype, archive
Object inner parameters: <param name= value= /> Embed attributes: type, src, pluginspace
Plugin Scriptability
Plugins can call and use JavaScript functions and objects: netscape.javascript.JSObject.getWindow() fscommand(command, args)
JavaScript can access public plugin members or even instantiate plugin types and classes:
JavaScript can control FlashPlayer with methods: IsPlaying, Play, StopPlay, Rewind
Flash8+ exports methods with
ExternalInterface.addCallback()
Homework
Create an HTML page that uses a plugin (Flash / Applet) and interact with it from JavaScript by calling methods / properties