VLC plugin and VIDEO-TS directory

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
jeanrosw
Blank Cone
Blank Cone
Posts: 13
Joined: 19 Jul 2010 13:59

VLC plugin and VIDEO-TS directory

Postby jeanrosw » 19 Jul 2010 14:22

To manage my music library (over 100 )I have developped some html pages using the VLC plug-in.

the plug-in is embedded in my pages with the following code:

<script language="javascript">
document.write('<OBJECT id="vlc1" width="600" height="380"');
if(-1 != navigator.userAgent.indexOf("MSIE")) document.write(' classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921">');
else if(-1 != navigator.userAgent.indexOf("Firefox"))document.write('type="application/x-vlc-plugin">');
document.write('<PARAM NAME="URL" VALUE=""><PARAM NAME="autoplay" VALUE=false></OBJECT>');
</SCRIPT>
I have added some controls as next, pause and stop and remaining time with the following code:

<table width=70%><tr align=center><td><a href="javascript:moins();">-</a></td>
<td> <a href="javascript:cafe('a1');" id="a1">Pause</a></td>
<td><a href="javascript:suite();">Next</a></td>
<td> <a href="javascript:fin();">Stop</a></td><td><a href="javascript:plus();">+</a></td>
</tr></table>

<script language="javascript">
function fin(){
var lien = document.getElementById('vlc1');
lien.playlist.stop();
do lien.playlist.items.clear();
while (lien.playlist.items.count>0);
lien.message.clear();
}

function cafe(x){
var lien = document.getElementById('vlc1');
lien.playlist.togglePause();
var stat = document.getElementById(x);
if (stat.firstChild.nodeValue=="Pause") stat.firstChild.nodeValue="Marche";
else stat.firstChild.nodeValue="Pause";
}

function suite(){
var lien = document.getElementById('vlc1');
lien.playlist.next();
}
</script>

the remaining time is done as :

<table><tr><td>
<span style="font-family: Arial; font-size: 12pt; text-decoration:none ; font-weight:bold; color:#FF6600">Temps restant: </span>
</td><td><p id="tir">000</p></td></tr></table>

<script language="javascript">
var reste=1000;
function temps(){
var lien = document.getElementById('vlc1');
total=lien.input.length;
posi=lien.input.position;
reste=total*(1-posi);
minu=Math.floor(reste/60000);
seco=Math.floor(reste/1000-minu*60);
txt=minu + " ' " +seco;

var tyu = document.getElementById('tir');
tyu.firstChild.nodeValue=txt;
ident=window.setTimeout("temps()",3000);
if (reste < 1000) suite();
}
</script>
It works well but now I am also opening directories containing VOB files and I would be interested to find a way to move from one track to another.
The next control is moving from one file in the playlist to the next and eventually in a VIDEO-TS directory from one VOB file to the next but not from one track to another as you can when using the VLC media player.

Does someone knows a solution to this probleme ?

Many thanks in advance for any help !

Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 4 guests