
Remote Control
FIG. 50 Controlling the value of the variable
It is also possible to use JavaScript directly to control the value of the shared variables. The sample code below assumes that we want to control the content on 192.168.1.10 by clicking on a rectangle.
<?xml version="1.0"
<svg xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/
<rect x="540" y="260" width="200" height="200" fill="blue"> <handler ev:event="click">
<![CDATA[
var v=createSharedVariable( "menu@192.168.1.10" ); v.set( "P1" );
]]>
</handler>
</rect></svg>
Remote Control of Playback
The playback.svg template in the Interactivity template folder acts as a transparent container for a single media file and lets you control its playback. Using this template, you can pause and restart any type of document including animations, playlists and videos.
When To Use Remote Control of Playback
You can use it to control the main document or for individual media files. It supports the following operations: Pausing and resuming playback.
Changing the current time position.
Synchronized control of the same media on multiple screens. Control from multiple clients over the network and/or serial port.
How To Use Remote Control of Playback
The control is based on a shared variable, the default name of which is “playback”. In its basic usage, it takes two values: “PLAY” or “PAUSE”.
For playback control on multiple screens or better resilience, an optional timestamp can follow the PLAY or PAUSE string (FIG. 51). It is defined as the time position in seconds where playback should pause or resume. This extra parameter enables unambiguous control over the timeline.
If the variable is stored in a central server, this lets you control the playing (or pause) time, even if the target device was off or has restarted in between two commands. It also enables frame accurate synchronization of playback on multiple targets, as well as control over the current time position.
Inspired XPress - Programming Guide | 39 |
|
|