summaryrefslogtreecommitdiff
path: root/skins/html/widgets/player.tmpl
blob: d6354e8e3c33860031d3c1f9d9ff910719bf6af9 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!-- player -->
<?% width = param.width %?>
<?% height = param.height %?>
<?% widget = param.widget %?>

<?% IF info.http_useragent.match('.*MSIE.*') && !info.http_useragent.match('.*Opera.*');
    msie = 1;
ELSE;
    msie = 0;
END %?>



<h1><?% param.title %?></h1>

<?% IF widget == 'vlc' && !msie %?>

<!-- vlc with mozilla -->
<script language="javascript">
<!--
   function volume_up()
   {
    var previous =  document.vlc.get_volume();
        var newvolume = previous + 10;
    if( newvolume > 200 )  newvolume = 200;
    document.vlc.set_volume( newvolume );
    var volume = document.getElementById("volume_status");
    var current =  document.vlc.get_volume();
    volume.innerHTML = current + " %";
   }

   function volume_down()
   {
    var previous =  document.vlc.get_volume();
        var newvolume = previous - 10;
    if( newvolume < 0 )  newvolume = 0;
    document.vlc.set_volume( newvolume );
    var current =  document.vlc.get_volume();
    volume.innerHTML = current + " %";
   }
   function status()
   {
        var play_status = document.getElementById("play_status");
        play_status.innerHTML = document.vlc.isplaying() 
          ? "<?% gettext("Playing") %?>" 
          : "<?% gettext("Not playing") %?>";
        setTimeout("status()", 1000 );
   }
//-->
</script>
<p align='center'>
          <embed type="application/x-vlc-plugin"
            pluginspage="http://www.videolan.org/vlc"
            name="vlc"
            autoplay="yes" loop="no" height="<?% height %?>" width="<?% width %?>"
            target="<?% data %?>" />
<br />
  <input type="button" id="play" value="<?% gettext("Playback") %?>" onClick='document.vlc.play()' />
  <input type="button" id="pause" value="<?% gettext("Pause") %?>" onClick='document.vlc.pause()' />
  <input type="button" id="stop" value="<?% gettext("Stop") %?>" onClick='document.vlc.stop()' />
  &nbsp;
  <input type="button" id="quiet" value="<?% gettext("Decrease volume") %?>" onClick='volume_down()' />
  <input type="button" id="loud" value="<?% gettext("Increase volume") %?>" onClick='volume_up()' />
  <input type="button" id="mute" value="<?% gettext("Mute") %?>" onClick='document.vlc.mute()' />
  &nbsp;
  <input type="button" id="fullscreen" value="<?% gettext("Full screen") %?>" onClick='document.vlc.fullscreen()' />
<br />
        <table summary="">
            <tr><td><?% gettext("Status") %?> : </td>
                <td><span id="play_status"><?% gettext("Unknown") %?></span></td></tr>
            <tr><td><?% gettext("Volume") %?> : </td><td><span id="volume_status"></span></td></tr>
        </table>
</p>

<script language="javascript">
<!--
  var volume = document.getElementById("volume_status");
  var current =  document.vlc.get_volume();
  volume.innerHTML = current + " %";
  setTimeout("status()", 1 );
//-->
</script>


<?% ELSIF widget == 'vlc' %?>

<!-- vlc with activeX -->
<p align='center'>
        <object classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" 
          codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
          height="<?% height %?>" width="<?% width %?>" id="vlc" events="True">
          <param name="Src" value="<?% data %?>" />
          <param name="ShowDisplay" value="True" />
          <param name="Loop" value="False" />
          <param name="AutoPlay" value="True" />
        </object>
<br />
          <input type="button" id="play" value="<?% gettext("Playback") %?>" onClick='doPlayOrPause()' />
          <input type="button" id="pause" value="<?% gettext("Pause") %?>" onClick='doPlayOrPause()' />
          <input type="button" id="stop" value="<?% gettext("Stop") %?>" onClick='document.vlc.stop()' />
          &nbsp;
          <input type="button" id="mute" value="<?% gettext("Mute") %?>" onClick='document.vlc.toggleMute()' />
<br />
          <table summary="">
            <tr><td><?% gettext("Status") %?> : </td>
                <td><span id="play_status"><?% gettext("Unknown") %?></span></td></tr>
          </table>
</p>

<script LANGUAGE="JScript">
<!--
var sliderTimerId = 0;

function onPlay() {
    document.getElementById("play_status").value = "<?% gettext("Playing") %?>";
};
function onPause() {
    document.getElementById("play_status").value = "<?% gettext("Paused") %?>";
};
function onStop() {
    document.getElementById("play_status").value = "<?% gettext("Not playing") %?>";
};

function doUpdate() {
    if( vlc.Playing ) {
        sliderTimerId = setTimeout("doUpdate()", 1000);
    }
    else {
        onStop();
        sliderTimerId = 0;
    }
};

function doPlayOrPause() {
    if( document.vlc.playing ) {
        document.vlc.pause();
    }
    else {
        document.vlc.play();
    }
};
function vlc::play() {
    if( ! sliderTimerId ) {
        sliderTimerId = setTimeout("doUpdate()", 1000);
    }
    onPlay();
};
function vlc::pause() {
    if( sliderTimerId ) {
        clearTimeout(sliderTimerId)
        sliderTimerId = 0;
    }
    onPause();
};
function vlc::stop() {
    if( sliderTimerId ) {
        clearTimeout(sliderTimerId)
        sliderTimerId = 0;
    }
    onStop();
};
//-->
</script>
<?% ELSE %?>
<!-- media player with activeX -->
<p align='center'>
    <object id="mediaPlayer" width="<?% width %?>" height="<?% height %?>"
        classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
        codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
        standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
        <param name="fileName" value="<?% data %?>" />
        <param name="animationatStart" value="true" />
        <param name="transparentatStart" value="true" />
        <param name="autoStart" value="true" />
        <param name="showControls" value="true" />
        <param name="loop" value="true" />
        <embed type="application/x-mplayer2"
            pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
            id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1"
            bgcolor='darkblue' showcontrols="true" showtracker="-1"
            showdisplay="0" showstatusbar="-1" videoborder3d="-1" width="<?% width %?>" height="<?% height %?>"
            src="<?% data %?>" autostart="true" designtimesp="5311" loop="true">
        </embed>
    </object>
</p>
<?% END %?>