// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function VLCversion() {
	var theMajor = revolunet.VLCObjectUtil.getPlayerVersion().major;
	var theMinor = revolunet.VLCObjectUtil.getPlayerVersion().minor;
	var theRev = revolunet.VLCObjectUtil.getPlayerVersion().rev;
	return (theMajor + "." + theMinor  + "." + theRev);
}

function VLCsetsize(w,h) {
	
	document.getElementById("myVLC").width=w;
	document.getElementById("myVLC").height=h;
	document.getElementById("tv").style.width=w;
	document.getElementById("tv").style.height=h+25;
	
}

function VLCsizebuttons(){
	
	document.write("<button id='Small' value='Small'  onClick='VLCsetsize(512,288);'>Small</button> ")
	document.write("<button id='Medium' value='Medium'  onClick='VLCsetsize(720,405);'>Medium</button> ")
	document.write("<button id='Large' value='Large'  onClick='VLCsetsize(1024,576);' >Large</button> ")
	
}


function VLCplay(theMRL) {
    var vlc = document.getElementById("myVLC");
    var options = " :vout-filter=deinterlace :deinterlace-mode=discard ";
	if (vlc.playlist.items.count > 0) {
		vlc.playlist.clear();
		vlc.playlist.items.clear();
	}
    vlc.playlist.add(theMRL, null, options);
    vlc.playlist.play();
}


function VLCstop() {
	   var vlc = document.getElementById("myVLC");
        vlc.playlist.stop();
}

function VLCmute() {
	   var vlc = document.getElementById("myVLC");
        vlc.audio.toggleMute();

}

function VLCfullscreen() {
	   var vlc = document.getElementById("myVLC");
        vlc.video.toggleFullscreen();
}

function VLCSubtitles() {
	   var vlc = document.getElementById("myVLC");
        vlc.video.toggleTeletext();
}





function VLCreport() {
	var vlc = document.getElementById("myVLC");
	var vlcreport = document.getElementById("vlcreport");

	var report = vlc.input.state + " // Size:" + vlc.video.width + "x" + vlc.video.height;

	vlcreport.innerHTML = report;
	}


