1dc333d4d708f967057a4a71894882572aa4b1bf
[atutor.git] / mods / atutor_opencaps / opencaps / projects / player_template.php
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
3 <html>
4 <head>
5 <title>Capscribe Movies</title>
6 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
7
8 <style type="text/css">
9         body {
10                 background-color: #FFFFFF;
11                 text-align:center;
12         }
13         
14         #movie-commands {
15                 list-style:none;
16                 margin: 0px 0px 0px -30px;
17                 font-weight: bold;
18                 padding:0px;
19         }
20         #movie-commands li {
21                 display:inline;
22                 padding: 5px;
23         }
24 </style>
25
26 <script language="JavaScript" type="text/javascript">
27 function stepback() {
28         var time = document.movie1.GetTime();
29         
30         if (time<5000)
31                 document.movie1.Rewind();
32         else
33                 document.movie1.SetTime(time-5000);
34 }
35
36 //adds missing zeros before number if ness
37 function padDigits(n, totalDigits) { 
38         n = n.toString(); 
39         var pd = ''; 
40         if (totalDigits > n.length)     { 
41                 for (i=0; i < (totalDigits-n.length); i++) { 
42                         pd += '0'; 
43                 } 
44         } 
45         return pd + n.toString(); 
46
47
48 function getFormattedTime(gt) {
49         var total = gt/document.movie1.GetTimeScale();
50
51         var gms = Math.round(total * 1000) % 1000;
52         
53         total = Math.floor(total);
54         
55         var gs = total % 60;
56         total = Math.floor(total / 60); 
57         
58         var gm = total % 60;
59         gh = Math.floor(total / 60);    
60         
61         var code = padDigits(gh, 2) + ":" + padDigits(gm, 2) + ":" + padDigits(gs, 2) + "." + padDigits(gms, 3);
62         return code;
63 }
64
65
66 function gettime() {
67         document.movie1.Stop();
68         var time = document.movie1.GetTime();
69         alert("The current time is " + getFormattedTime(document.movie1.GetTime()));
70 }
71
72 </script>
73
74 </head>
75
76
77 <body>
78
79 <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="%width%" height="%height%" id="movie1">
80         <param name="src" value="smil.mov">
81         <param name="enablejavascript" value="true">
82         <param name="autoplay" value="false">
83         <param name="bgcolor" value="#000000">
84         <param name="controller" value="true">
85         
86         <embed src="smil.mov" width="%width%" height="%height%" pluginspage="http://www.apple.com/quicktime/download/" name="movie1" enablejavascript="true" id="movie1_embed" postdomevents="true" autoplay="false" controller="true" />
87 </object>
88
89 <div style="margin-top:1px; background: #a9a9a9">
90         <ul id="movie-commands">
91                 <li><a href="#" onclick="javascript:document.movie1.Play();">Play</a></li>
92                 <li><a href="#" onclick="javascript:document.movie1.Stop();">Stop</a></li>      
93         
94                 <li><a href="#" onclick="javascript:gettime()">Get Movie Time</a></li>  
95                 
96                 <li><a href="#" onclick="javascript:document.movie1.Rewind();">Rewind</a></li>
97                 <li><a href="#" onclick="stepback();">Step Back</a></li>
98                 <li><a href="#" onclick="javascript:document.movie1.SetTime(document.movie1.GetTime()+5000);">Step Ahead</a></li>
99         
100         
101         </ul>   
102 </div>
103         
104
105 </body>
106 </html>