Home   Documentation   Demonstrations   Download

AMICO: Documentation / AMICO Modules / AMICO Applets

URL Changer Applet

...

Scripting Applet

In order to control multimedia content in Web browsers using interaction modalities not present in the user interface of the browser, we have developed a flexible mechanism for mapping of communicator variables to Web browser controls. Browsers usually provide several ways in which they can be extended. For example, it is possible to develop new plug-in modules, or toolbar extension, and in that way affect the content loaded in the Web browser. However, this approach requires development of components for each browser and platform, and requires that users install them in order to be used. Instead of that, we provide a simpler, but equally functional way of controlling the content loaded in the Web browser using a scripting applet. The scripting applet transforms notifications sent from the communicator into calls of scripting functions. The scripting applet is completely reconfigurable, and developers can use it to control any scriptable element in the HTML page.
 

<script>

               function p_start() { document.movieclip.DoPlay()               }

               function p_pause() { document.movieclip.DoPause()               }

               function p_stop() { document.movieclip.DoStop()               }

               function p_set_volume(volume) {

                                       document.movieclip.SetVolume(volume)

               }

               function p_set_bgColor(color) {

                                       document.bgColor=color

               }

</script>

……

<applet code="ScriptingApplet.class" width="0" width="0" MAYSCRIPT>

    <param name="port" value="3320">

    <param name="command-template-1"
          value="ADD TEMPLATE DIFF player-action
p_<%=player-action%>">

    <param name="command-template-2"
          value="ADD TEMPLATE DIFF bg-color
p_set_bgColor <%=bg-color%>">

</applet>

Parameters for the ScriptingApplet used to control the playback of the RealPlayer plugin.

Figure illustrate parameters of the scripting applet used to control the playback of the RealPlayer plugin. The applet registers for change of variables named 'player-action' ('start', 'pause', 'stop', or 'set_volume <value>'), and variable 'bg-color'. Whenever these variables change, the applet receives a string such as 'p_start', and it calls the script function with the same name.

We have used our applet to control interaction in Mozilla, Firefox, and Internet Explorer Web browsers, including:

·       Controlling standard elements of HTML page through DOM interfaces, changing content, such as text in some paragraph, style elements, such as background color, or the layout, like moving image controls by camera.

·       Controlling playback in multimedia movie and music plugins, such as RealPlayer, Windows Media Player, and QuickTime players,

·       Accessing and manipulating VRML scenes, using VRML External Authoring Interface (EAI) scripting API exposed by VRML players.

 

 

Validation Logos