subtitles are working on 1.0.5 with the demo on your websitefzone, subtitles have now been disabled dut to security restrictions in VLC >=1 ;(
Code: Select all
<html>
<title>VLC Mozilla plugin test page</title>
<body>
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
width="640"
height="480"
id="vlc"
autoplay="yes"
target="http://server/streaming/playlist.m3u">
</embed>
<script language="Javascript">
var vlc = document.getElementById("vlc");
vlc.audio.toggleMute();
vlc.play();
</script>
</body>
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript">
document.onkeyup = keyDown;
function keyDown(e)
{
var key = (window.event) ? event.keyCode : e.keyCode;
//alert(key);
if(key == 0)
{
location = "http://localhost/fragrant/index.php";
}
else if(key == 8)
{
location = "http://localhost/fragrant/fgmusic/index.php";
}
}
</script>
<style>
body { margin:0px;
background:url(BG/BG-Sub-Music.png);
background-repeat:no-repeat;
}
.video{
position:absolute;
left:316px;
top:256px;
}
.mediaSkin{
position:absolute;
left:293px;
top:220px;
}
.control{
position:absolute;
left:307px;
top:556px;
}
.playlistContainer{
position:absolute;
left:706px;
top:258px;
text-align:left;
padding:10px;
outline-style:groove;
outline-color:#999999;
width:314px;
height:258px;
background-color:#FFFFFF;
overflow:scroll;
z-index:1;
}
.currentSongContainer{
position:absolute;
left:455px;
top:224px;
text-align:center;
padding:2px;
width:450px;
height:24px;
float:left;
font-size:20px;
color:#FFFF00;
z-index:2;
}
.songList{
position:absolute;
left:706px;
top:258px;
text-align:left;
padding:10px;
width:314px;
height:258px;
color:#FFFF00;
z-index:3;
}
</style>
</head>
<body onload="javascript:addSongToPlaylist();">
<div class="video"><embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2"
width="380"
height="285"
id="vlc" autoplay="yes" loop="yes">
</embed>
</div>
<script language="Javascript">
var vlc=document.getElementById('vlc');
var currentSongContainer=document.getElementById('currentSongContainer');
var currentSong=0;
var i;
var playlist=new Array();
<?php /*?> <? foreach ($data as $songname){?>
playlist.push('<? echo str_replace("\r\n","",$songname);?>');
<?
}
?><?php */?>
function showPlaylist(){
var playlistBtn=document.getElementById('playlistBtn');
var displayPlaylist=document.getElementById('playlistContainer');
var songList=document.getElementById('songList');
var allSong="";
for (i=0;i<playlist.length;i++)
{
allSong=allSong+playlist[i].replace('.flv','')+"<br/>";
}
displayPlaylist.innerHTML="Your Playlist<br/><hr/>"+allSong;
if (displayPlaylist.style.display=="none"){
displayPlaylist.style.display="";
playlistBtn.src="images/bluePlaylistBtn.png";
songList.style.display="none";
}else if(displayPlaylist.style.display==""){
displayPlaylist.style.display="none";
playlistBtn.src="images/bluePlaylistBtn_hide.png";
songList.style.display="";
}
}
function addSongToPlaylist(){
<? $data=file("playlist.m3u"); ?>
<? foreach ($data as $songname){?>
playlist.push('<? echo str_replace("\r\n","",$songname);?>');
<?
}
?>
for (i=0;i<playlist.length;i++)
{
vlc.playlist.add(playlist[i],playlist[i],'options');
}
}
// var vlc = document.getElementById("vlc");
function getCurrSongLength(){
var vlc = document.getElementById("vlc");
var currSongLength=vlc.input.length;
alert(currSongLength);
}
function play(){
if (vlc.playlist.items.count <=0){
return;
}
vlc.playlist.play();
var currentSongContainer=document.getElementById('currentSongContainer');
currentSongContainer.innerHTML="Track: "+playlist[currentSong].replace('.flv','');
}
function stop(){
vlc.playlist.stop();
}
function prev(){
if (vlc.playlist.items.count <=0){
return;
}
vlc.playlist.prev();
currentSong--;
var currentSongContainer=document.getElementById('currentSongContainer');
currentSongContainer.innerHTML="Track: "+playlist[currentSong].replace('.flv','');
}
function next(){
vlc.playlist.next();
if (vlc.playlist.items.count <=0){
return;
}
if ((currentSong+1) <vlc.playlist.itemCount){
currentSong++;
}
/* if ((currentSong+1)==vlc.playlist.itemCount){
vlc.playlist.play(0);
currentSong=0;
}*/
var currentSongContainer=document.getElementById('currentSongContainer');
currentSongContainer.innerHTML="Track: "+playlist[currentSong].replace('.flv','');
}
function pause(){
vlc.playlist.togglePause() ;
}
function mute(){
var vlc=document.getElementById('vlc');
var btn=document.getElementById('muteBtn');
var isPlaying=vlc.playlist.isPlaying;
if (isPlaying){
var muteState=vlc.audio.mute;
if(muteState){
vlc.audio.mute=false;
btn.src="images/blueUnmuteBtn.png";
return;
}
if(!muteState){
vlc.audio.mute=true;
btn.src="images/blueMuteBtn.png";
return;
}
}
}
function short(){
var vlc=document.getElementById('vlc');
alert(vlc.audio.track);
}
function playLast(){
}
///MY
function getTotal()
{
var vlc = document.getElementById("vlc");
var total=vlc.playlist.itemCount;
var total=vlc.playlist.items.count;
alert(total);
}
function currTrack(){
alert(currentSong);
}
function writeTextFile(mode){
var songName1="";
var songName2="";
var pageName="megan.php";
if(document.getElementById('track1').checked==true){
songName1=document.getElementById('track1').value;
}
if(document.getElementById('track2').checked==true){
songName2=document.getElementById('track2').value;
}
window.location="get_song.php?mode="+mode+"&songName1="+songName1+"&songName2="+songName2+"&pageName="+pageName;
// addSongToPlaylist();
}
function compare(){
var ctime=vlc.input.time;
var songlength=vlc.input.length;
if (songlength-ctime <=1000){
next();
}
}
function startCompare(){
var isPlaying=vlc.playlist.isPlaying;
if (isPlaying){
intval = setInterval(compare, 1000);
}
}
setInterval(startCompare,10000);
</script>
<div id="songList" class="songList">
<input type="checkbox" id="track1" value="Lighters.flv"/>Lighters<br/>
<input type="checkbox" id="track2" value="The_Lazy_Song.flv"/>The_Lazy_Song
<hr/>
<input type="button" value="New Playlist" onclick="javascript:writeTextFile('w');"/>
<input type="button" value="Add to Playlist" onclick="javascript:writeTextFile('a');"/>
</div>
<div id="playlistContainer" style="display:none" class="playlistContainer">
Your Playlist<br/>
<hr/>
</div>
<div id="currentSongContainer" class="currentSongContainer"></div>
<div id="mediaSkin" class="mediaSkin">
<table width="774" border="0" height="424" style="background-image:url(images/musicBox.png); background-repeat:no-repeat">
<tr>
<td rowspan="2" >
<!--
video
-->
</td>
<td valign="top">
</td>
</tr>
<tr>
<td height="60" align="center">
</td>
</tr>
</table>
</div>
<div class="control">
<table width="748" border="0" style="background:url(images/control.png); background-repeat:no-repeat" height="78">
<tr>
<td valign="middle" align="center"><input type="image"src="images/blueUnmuteBtn.png" style="vertical-align:super" onclick="mute();" id="muteBtn"/> <input type="image" src="images/bluePreviousBtn.png" style="vertical-align:super" onClick="prev();"/> <input type="image" src="images/bluePauseBtn.png" style="vertical-align:super" onClick="pause();"/> <input type="image" src="images/bluePlayBtn.png" onClick="play();"/> <input type="image" src="images/blueStopBtn.png" style="vertical-align:super" onClick="stop();"/> <input type="image" src="images/blueNextBtn.png" style="vertical-align:super" onClick="next();" /> <input type="image" src="images/bluePlaylistBtn.png" style="vertical-align:super" onclick="javascript:showPlaylist();" id="playlistBtn"/></td>
</tr>
</table>
</div>
</body>
</html>
Code: Select all
<script>
var vlc = document.getElementById("ch1"
vlc.playlist.add("udp://@233.1.1.11:1000","fancy name", new Array(":program=2"));
vlc.playlist.play();
vlc.video.deinterlace.enable("blend");
</script>
Users browsing this forum: No registered users and 6 guests