Jump to content

JS controls for WMV


Ovaire d'Oz

Recommended Posts

Hello,I am adding WMV content to some webpages, I decided to design custom buttons to control the video, I scripted controls too but I'm facing some compatibility problems; the buttons will work only with IE. Could someone have a look a the code and help me? Thanks.

// video controlfunction WMP_Button_Click(command){	var wmp = document.WMP_Video_IE;	switch(command)	{		case "play":{wmp.controls.Play();}break;		case "stop":{wmp.controls.Stop();}break;		case "pause":{wmp.controls.Pause();}break;		case "mute":		{			wmp.settings.mute = !wmp.settings.mute;		}		break;		case "sound_up":		{			volume = wmp.settings.volume;			volume += 20;			if(volume > 100) volume=100;			wmp.settings.volume = volume;		}		break;		case "sound_down":		{			volume = wmp.settings.volume;			volume -=20;			if(volume < 0) volume=0;			wmp.settings.volume = volume;		}		break;	}}//chaptersfunction chapitre(temps){		var wmp = document.WMP_Video_IE;	//time infos using substring	var h = temps.substring(0,2);	var m = temps.substring(3,5);	var s_ms = temps.substring(6);	//number of seconds calcul	seconds = parseInt(h) * 3600 + parseInt(m) * 60 + parseFloat(s_ms);	//Reader positionning	document.WMP_Video_IE.controls.currentPosition = seconds;	document.WMP_Video_IE.controls.play();}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...