VLC HTML plugin with Play list..

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
sheeraz
New Cone
New Cone
Posts: 2
Joined: 29 Sep 2011 09:48

VLC HTML plugin with Play list..

Postby sheeraz » 29 Sep 2011 10:27

Thanks in advance my friends.. I am new to the forum and know very basic HTML..

Kinldy if you can send me the detailed code I want to play videos on my webpage. The videos are lying in the same folder. I want to have play pause and stop control of video and it should show the select play list some where in the page..

I am using the below code to run the single video.I cant define multiple videos. I did not know how to add play list. The play list a.xspf is lying the same root folder..




<div align="center">ABC Service
<table>
<tr> <td>
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
width="593"
height="412"
autoplay="no"
id="vlc"
target="2.avi"></embed>
<div id="info">
</div>
<input type="button" class="sed1" onclick="else_r();" size='30' value="Play list" /></td>
<td>
<script type="text/javascript">

var vlc = document.getElementById("vlc");
if(vlc){
document.getElementById("info").innerHTML = "Ready";
} else {
document.getElementById("info").innerHTML = "Not Ready";
}
function mute(){
vlc.audio.toggleMute();
}
function play(){
vlc.playlist.play();
intval = setInterval(uptime, 250);
}
function stop(){
clearInterval(intval);
vlc.playlist.stop();

}
function pause(){
vlc.playlist.togglePause();
}
function c_time(){
return eval(vlc.input.time / 1000);
}
function seek(value){
var vlc = document.getElementById("vlc");
//alert(value);
vlc.input.time = eval(value*1000)
//return true;
}
function backof(value){
var vlc = document.getElementById("vlc");
vlc.input.time = vlc.input.time - eval(value*1000);
//alert(vlc.input.state);
//return true;
}

function uptime(){
document.getElementById("nowt").innerHTML = eval(vlc.input.time/1000);
}
function else_r(){
oi = document.getElementById("txtout");
oi.value = '';
oi.value += vlc.versionInfo() +"\n";
oi.value += "VLC position " + vlc.input.position +"\n";
oi.value += "VLC length " + vlc.input.length +"\n";
oi.value += "VLC rate " + vlc.input.rate +"\n";
oi.value += "VLC is Playing " + vlc.playlist.isPlaying +"\n";
}
</script>
<input type="button" onclick='play();' value="Play" />
<input type="button" onclick='pause();' value="Pause" />
<input type="button" onclick='stop();' value="Stop" />
<input type="button" onclick='document.getElementById("info").innerHTML = c_time();' value="Time" />
<input type="button" onclick='mute();' value="Mute" />
<div>
<input id="seekto" type="text" size="4" value="10" />
<input type="button" class="sed1" onclick="seek(document.getElementById('seekto').value);" size='30' value="Seek (sec)" />
<input id="backof" type="text" size="4" value="5" />
<input type="button" class="sed1" onclick="backof(document.getElementById('backof').value);" size='30' value="Back of (sec)" />
</div>
<div id="nowt">
</div>
</td></tr>
</table>
</div>

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: VLC HTML plugin with Play list..

Postby Ilasir » 03 Oct 2011 23:59

If the videos are all in the same folder, you're better off using a php loop to create a playlist on pageload.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 6 guests