File: javascript.html

package info (click to toggle)
cortado 0.2.2-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,232 kB
  • ctags: 2,515
  • sloc: java: 17,356; xml: 532; sh: 58; makefile: 15
file content (58 lines) | stat: -rw-r--r-- 1,836 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!-- That is a simple example how to use the cortado applet. Please replace the
     URL below by one that matches your setup.

     The applet parameters can be changed from javascript by calling the
     setParam(key, value) on the applet. After setting the new parameters in
     the applet it needs to be restarted with the restart() method for the
     changes to take effect.

     The following piece of HTML demonstrates switching URLs with an without
     sound using javascript. The applet can be controlled with the following
     javascript methods:

     doPlay(): Start playback
     doPause(): Pause playback
     doStop(): Stop playback
     doSeek(double pos); seek to a new position, must be between 0.0 and 1.0.
-->


<html>
 <head>
 </head>
 <body>
   <script language="javascript">
     function restart() {
       document.applets[0].restart(); 
     }
     function loadUrl(uri, audio) {
       document.applets[0].setParam("audio", audio); 
       document.applets[0].setParam("url", uri); 
       restart();
     }
   </script>
   <applet archive="http://localhost/cortado/cortado.jar" code="com.fluendo.player.Cortado.class" width="320" height="240"> 
     <param name="url" value="http://localhost/~twerner/09_20h_ReadWriteSociety.ogg"/>
     <param name="local" value="false"/>
     <param name="framerate" value="5.0"/>
     <param name="keepaspect" value="true"/>
     <param name="video" value="true"/>
     <param name="audio" value="true"/>
   </applet>

   <br/>
   <br/>

   <button onClick="restart()">
    Restart
   </button>
   <button onClick="loadUrl('http://localhost/~twerner/09_20h_ReadWriteSociety.ogg', 'true')">
    With Audio
   </button>
   <button onClick="loadUrl('http://localhost/~twerner/09_20h_ReadWriteSociety.ogg', 'false')">
    Without Audio
   </button>
   
 </body>
</html>