Posté : 19-07-2013 06:50
personnes pour virer les postes plus haut là ?
bon sinon voici le code complet pour vlc :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<TITLE>VLC Plugin test page</TITLE>
<STYLE>
.inputTrackerInput {
height:20;
width:30;
font-family : Arial , Helvetica, sans-serif;
font-size : 12px;
< br /> }
</STYLE>
<SCRIPT language="!javascript!"><!--
function init()
{
if( navigator.appName.indexOf("Microsoft In ternet")==-1 )
{
onVLCPluginReady()
}
else if( document.readyState == ' complete' )
{
onVLCPluginReady();
}
else
{
/* Explorer loads&n bsp;plugins asynchronously */
document.onreadystatechange=f unction()
{
if(&n bsp;document.readyState == 'complete' )
{
  ; onVLCPluginReady();
}
}
}
}
function getVLC(name)
{
if (window.document[name])
{
return window.document[n ame];
}
if (navigator.appName.indexOf("Microsoft In ternet")==-1)
{
if (document.!embed!s&nb sp;&& document.!embed!s[name])
retur n document.!embed!s[name];
}
else // if (navigator.appName.indexOf( "Microsoft Internet")!=-1)
{
return document.getEleme ntById(name);
}
}
function registerVLCEvent(event, handler)
{
var vlc = getVLC("vlc");
if (vlc) {
if (vlc.attachEvent)&nbs p;{
//&nb sp;Microsoft
vlc.a ttachEvent (event, handler);
} else if (vlc .addEventListener) {
//&nb sp;Mozilla: DOM level 2
vlc.a ddEventListener (event, handler, true);
} else {
//&nb sp;DOM level 0
eval( "vlc.on" + event + " = handler");
}
}
}
function unregisterVLCEvent(event, handler)
{
var vlc = getVLC("vlc");
if (vlc) {
if (vlc.detachEvent)&nbs p;{
//&nb sp;Microsoft
vlc.d etachEvent (event, handler);
} else if (vlc .removeEventListener) {
//&nb sp;Mozilla: DOM level 2
vlc.r emoveEventListener (event, handler, true);
} else {
//&nb sp;DOM level 0
eval( "vlc.on" + event + " = null");
}
}
}
// JS VLC API callbacks
function handleMediaPlayerMediaChanged()
{
document.getElementById("info").innerHTML =  ;"Media Changed";
}
function handle_MediaPlayerNothingSpecial()
{
document.getElementById("state").innerHTML =&nbs p;"Idle...";
}
function handle_MediaPlayerOpening()
{
onOpen();
}
function handle_MediaPlayerBuffering(val)
{
document.getElementById("info").innerHTML =  ;val + "%";
}
function handle_MediaPlayerPlaying()
{
onPlay();
}
function handle_MediaPlayerPaused()
{
onPause();
}
function handle_MediaPlayerStopped()
{
onStop();
}
function handle_MediaPlayerForward()
{
document.getElementById("state").innerHTML =&nbs p;"Forward...";
}
function handle_MediaPlayerBackward()
{
document.getElementById("state").innerHTML =&nbs p;"Backward...";
}
function handle_MediaPlayerEndReached()
{
onEnd();
}
function handle_MediaPlayerEncounteredError()
{
!onerror!();
}
function handle_MediaPlayerTimeChanged(time)
{
var vlc = getVLC("vlc");
var info = document.getElementById("in fo");
if( vlc )
{
var mediaLen =  ;vlc.input.length;
if( mediaLen >&n bsp;0 )
{
//&nb sp;seekable media
info. innerHTML = formatTime(time)+"/"+formatTime(mediaLen);
}
}
}
function handle_MediaPlayerPositionChanged(val)
{
// set !javascript! slider to&nbs p;correct position
}
function handle_MediaPlayerSeekableChanged(val)
{
setSeekable(val);
}
function handle_MediaPlayerPausableChanged(val)
{
setPauseable(val);
}
function handle_MediaPlayerTitleChanged(val)
{
//setTitle(val);
document.getElementById("info").innerHTML =  ;"Title: " + val;
}
function handle_MediaPlayerLengthChanged(val)
{
//setMediaLength(val);
}
// VLC Plugin
function onVLCPluginReady()
{
registerVLCEvent("MediaPlayer MediaChanged", handleMediaPlayerMediaChanged);
registerVLCEvent("MediaPlayer NothingSpecial", handle_MediaPlayerNothingSpecial);
registerVLCEvent("MediaPlayer Opening", handle_MediaPlayerOpening);
registerVLCEvent("MediaPlayer Buffering", handle_MediaPlayerBuffering);
registerVLCEvent("MediaPlayer Playing", handle_MediaPlayerPlaying);
registerVLCEvent("MediaPlayer Paused", handle_MediaPlayerPaused);
registerVLCEvent("MediaPlayer Stopped", handle_MediaPlayerStopped);
registerVLCEvent("MediaPlayer Forward", handle_MediaPlayerForward);
registerVLCEvent("MediaPlayer Backward", handle_MediaPlayerBackward);
registerVLCEvent("MediaPlayer EndReached", handle_MediaPlayerEndReached);
registerVLCEvent("MediaPlayer EncounteredError", handle_MediaPlayerEncounteredError);
registerVLCEvent("MediaPlayer TimeChanged", handle_MediaPlayerTimeChanged);
registerVLCEvent("MediaPlayer PositionChanged", handle_MediaPlayerPositionChanged);
registerVLCEvent("MediaPlayer SeekableChanged", handle_MediaPlayerSeekableChanged);
registerVLCEvent("MediaPlayer PausableChanged", handle_MediaPlayerPausableChanged);
registerVLCEvent("MediaPlayer TitleChanged", handle_MediaPlayerTitleChanged);
registerVLCEvent("MediaPlayer LengthChanged", handle_MediaPlayerLengthChanged);
}
function close()
{
unregisterVLCEvent("MediaPlayerMediaChanged", ha ndleMediaPlayerMediaChanged);
unregisterVLCEvent("MediaPlayerNothingSpecial", handle_MediaPlayerNothingSpecial);
unregisterVLCEvent("MediaPlayerOpening", handle_ MediaPlayerOpening);
unregisterVLCEvent("MediaPlayerBuffering", handl e_MediaPlayerBuffering);
unregisterVLCEvent("MediaPlayerPlaying", handle_ MediaPlayerPlaying);
unregisterVLCEvent("MediaPlayerPaused", handle_M ediaPlayerPaused);
unregisterVLCEvent("MediaPlayerStopped", handle_ MediaPlayerStopped);
unregisterVLCEvent("MediaPlayerForward", handle_ MediaPlayerForward);
unregisterVLCEvent("MediaPlayerBackward", handle _MediaPlayerBackward);
unregisterVLCEvent("MediaPlayerEndReached", hand le_MediaPlayerEndReached);
unregisterVLCEvent("MediaPlayerEncounteredError",&nbs p;handle_MediaPlayerEncounteredError);
unregisterVLCEvent("MediaPlayerTimeChanged", han dle_MediaPlayerTimeChanged);
unregisterVLCEvent("MediaPlayerPositionChanged",  ;handle_MediaPlayerPositionChanged);
unregisterVLCEvent("MediaPlayerSeekableChanged",  ;handle_MediaPlayerSeekableChanged);
unregisterVLCEvent("MediaPlayerPausableChanged",  ;handle_MediaPlayerPausableChanged);
unregisterVLCEvent("MediaPlayerTitleChanged", ha ndle_MediaPlayerTitleChanged);
unregisterVLCEvent("MediaPlayerLengthChanged", h andle_MediaPlayerLengthChanged);
}
//--></SCRIPT>
<BODY !onload!="init();" onClose="close();">
<TABLE>
<TR><TD colspan="2">
MRL:
<INPUT size="90" id="targetTextField" value="">
<INPUT type=submit value="Go" !onclick!="doGo(document.getE lementById('targetTextField').value);">
<INPUT type=submit value="Add" !onclick!="doAdd(document.ge tElementById('targetTextField').value);">
</TD></TR>
<TR><TD align="center" colspan="2">
<!--
Insert VideoLAN.VLCPlugin.2
-->
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
width="640"
height="480"
id="vlc"
events="True">
<param name="MRL" value="" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="False" />
<param name="Volume" value="50" />
<param name="toolbar" value="true" />
<param name="StartTime" value="0" />
<!embed! pluginspage="http://www.videolan.org"
type="application/x-vlc-plugin"
version="VideoLAN.VLCPlugin.2"
width="640"
height="480"
toolbar="true"
text="Waiting for video"
name="vlc">
</!embed!>
</OBJECT>
</TD></TR>
<TR><TD colspan="2">
<TABLE><TR>
<TD valign="top" width="550">
<!--
Insert Slider widget
-->
<DIV id="inputTrackerDiv"</DIV>
</TD><TD width="15%">
<DIV id="info" style="text-align:center">-:--:--/-:--:--</ DIV>
<DIV id="state" style="text-align:center">Stopped...</DIV& gt;
</TD></TR></TABLE>
</TD></TR>
<TR><TD>
<INPUT type=button id="PlayOrPause" value=" Play " !onclick!='doPlayOrPause();'>
<INPUT type=button value="Stop" !onclick!='doStop();'>
< br />
<INPUT type=button value=" << " !onclick!=' doPlaySlower();'>
<INPUT type=button value="Reverse" !onclick!='doReverse();' >
<INPUT type=button value=" >> " !onclick!=' doPlayFaster();'>
<INPUT type=button value="Fullscreen" !onclick!='getVLC("vl c").video.toggleFullscreen();'>
<INPUT type=button value="Version" !onclick!='alert("vlc&nb sp;" + getVLC("vlc").VersionInfo);'>
<INPUT type=button value=" State " !onclick!='ale rt("state: " + getVLC("vlc").input.state);'>
</TD><TD align="right">
<SPAN style="text-align:center">Volume:</SPAN>
<INPUT type=button value=" - " !onclick!='updateV olume(-10)'>
<SPAN id="volumeTextField" style="text-align:center">--</S PAN>
<INPUT type=button value=" + " !onclick!='updateV olume(+10)'>
<INPUT type=button value="Mute" !onclick!='getVLC("vlc").au dio.toggleMute();'>
</TD>
</TR>
<TR><TD>Playlist:
<INPUT type=button value="Prev" !onclick!='getVLC("vlc").pl aylist.prev();'>
<INPUT type=button value="Next" !onclick!='getVLC("vlc").pl aylist.next();'>
<INPUT type=button value="Clear All" !onclick!='doPlay listClearAll();'>
Aspect Ratio:
<SELECT readonly onChange='doAspectRatio (this.value)'>
<OPTION value="default">Defaul t</OPTION>
<OPTION value="1:1">1:1</OP TION>
<OPTION value="4:3">4:3</OP TION>
<OPTION value="16:9">16:9</ OPTION>
<OPTION value="221:100">221:10 0</OPTION>
<OPTION value="5:4">5:4</OP TION>
</SELECT>
</TD><TD align="right">
<INPUT type=button id="itemCount" value=" Items 0 " !onclick!='doItemCount();'>
<INPUT size=4 value="" id="removeid"><INPUT type =submit value="Delete" !onclick!="doRemoveItem(document.getElementByI d('removeid').value);">
</TD>
</TR>
<TR><TD>Audio Channel:
<SELECT readonly !onclick!='doAudioChannel(this.valu e);'>
<OPTION value=1>Stereo</OPTION>
<OPTION value=2>Reverse Stereo</OP TION>
<OPTION value=3>Left</OPTION>
<OPTION value=4>Right</OPTION>
<OPTION value=5>Dolby</OPTION>
</SELECT>
</TD>
<TD>
<INPUT type=button value="current channel" !onclick!=' alert(getVLC("vlc").audio.channel);'>
</TD>
</TR>
<TR><TD> Audio Track:
<INPUT type=button value=" + " !onclick!='doAudio Track(1);'>
<SPAN id="trackTextField" style="text-align:center">--</SP AN>
<INPUT type=button value=" - " !onclick!='doAudio Track(-1);'>
<INPUT type=button value="current track" !onclick!='al ert(getVLC("vlc").audio.description(vlc.audio.track));'>
<INPUT type=button value="number of track" !oncli ck!='alert(getVLC("vlc").audio.count);'>
</TD>
<TD>
<INPUT type=button value="set slider" !onclick!='doSet Slider();'>
<INPUT type=button value="get position" !onclick!='doG etPosition();'>
</TD>
</TR>
<TR>
<TD>Video Subtitle:
<INPUT type=button value=" + " !onclick!='doSubtitle(1);'>
<SPAN id="spuTextField" style="text-alig n:center">--</SPAN>
<INPUT type=button value=" - " !onclick!='doSubtitle(-1);'>
<INPUT type=button value="current s ubtitle" !onclick!='alert(getVLC("vlc").subtitle.description(vlc.subtitle. track));'>
<INPUT type=button value="number of subtitle" !onclick!='alert(getVLC("vlc").subtitle.count);'>
</TD>
</TR>
<TR>
<TD>Deinterlacing:
<INPUT type=button value="BLEND" !o nclick!='getVLC("vlc").video.deinterlace.enable("blend");'>
<INPUT type=button value=" X& nbsp; " !onclick!='getVLC("vlc").video.deinterlace.enable("x");'>
<INPUT type=button value="Disable" !onclick!='getVLC("vlc").video.deinterlace.disable();'>
</TD>
</TR>
<TR>
<TD>Marquee video filter:
<INPUT type=button value="Enable" ! onclick!='getVLC("vlc").video.marquee.enable();'>
<INPUT type=button value="Disable" !onclick!='getVLC("vlc").video.marquee.disable();'>
<INPUT size=4 value="" id="marqueeI ntValue">
<SELECT readonly !onclick!="doMarqueeOpt ion(this.value,document.getElementById('marqueeIntValue').value);">
<OPTION value=1>Co lor</OPTION>
<OPTION value=2>Op acity</OPTION>
<OPTION value=3>Po sition</OPTION>
<OPTION value=4>!r efresh!</OPTION>
<OPTION value=5>Si ze</OPTION>
<OPTION value=6>Te xt</OPTION>
<OPTION value=7>Ti meout</OPTION>
<OPTION value=8>X& lt;/OPTION>
<OPTION value=9>Y& lt;/OPTION>
</SELECT>
</TD>
</TR>
<TR>
<TD>Logo video filter:
<INPUT type=button value="Enable" ! onclick!='getVLC("vlc").video.logo.enable();'>
<INPUT type=button value="Disable" !onclick!='getVLC("vlc").video.logo.disable();'>
<INPUT size=4 value="" id="logoIntV alue">
<SELECT readonly !onclick!="doLogoOption (this.value,document.getElementById('logoIntValue').value);">
<OPTION value=1>Fi le</OPTION>
<OPTION value=2>Po sition</OPTION>
<OPTION value=3>Op acity</OPTION>
<OPTION value=4>Re peat</OPTION>
<OPTION value=5>De lay</OPTION>
<OPTION value=6>X& lt;/OPTION>
<OPTION value=7>Y& lt;/OPTION>
</SELECT>
</TD>
</TR>
<TR>
<TD>
<INPUT type=button id="telx" value= "Teletext off" !onclick!='doToggleTeletext();'>
Teletext page:
<INPUT size=4 value="100" id="telxP age" !onclick!='doTelxPage(document.getElementById("telxPage").value);'> ;
</TD>
</TR>
</TABLE>
<SCRIPT language="!javascript!">
<!--
var rate = 0;
var prevState = 0;
var telxState = false;
var canPause = true;
var canSeek = true;
function setPauseable(val)
{
canPause = val;
}
function setSeekable(val)
{
canSeek = val;
}
function doSetSlider()
{
var vlc = getVLC("vlc");
// set slider to new positio n
if( vlc )
vlc.input.time = (v lc.input.length/2);
}
function doGetPosition()
{
var vlc = getVLC("vlc");
// set slider to new positio n
if (vlc)
alert( "position is " + vlc.input.time);
}
function doReverse(rate)
{
var vlc = getVLC("vlc");
if( vlc )
vlc.input.rate = -1 .0 * vlc.input.rate;
}
function doAudioChannel(value)
{
var vlc = getVLC("vlc");
if( vlc )
vlc.audio.channel =  ;parseInt(value);
}
function doAudioTrack(value)
{
var vlc = getVLC("vlc");
if( vlc )
{
vlc.audio.track = v lc.audio.track + value;
document.getElementById("trac kTextField").innerHTML = vlc.audio.track;
}
}
function doAspectRatio(value)
{
var vlc = getVLC("vlc");
if( vlc )
vlc.video.aspectRatio =& nbsp;value;
}
function doSubtitle(value)
{
var vlc = getVLC("vlc");
if( vlc )
{
vlc.subtitle.track =&nbs p;vlc.subtitle.track + value;
document.getElementById("spuT extField").innerHTML = vlc.subtitle.track;
}
}
function doTelxPage(value)
{
var vlc = getVLC("vlc");
if( vlc )
vlc.video.teletext =&nbs p;parseInt(value);
}
function doToggleTeletext()
{
var vlc = getVLC("vlc");
if( vlc )
{
vlc.video.toggleTeletext();
< br /> if (telxState)
{
docum ent.getElementById("telx").innerHTML = "Teletext on";
telxS tate = true;
}
else
{
docum ent.getElementById("telx").innerHTML = "Teletext off";
telxS tate = false;
}
}
}
function doItemCount()
{
var vlc = getVLC("vlc");
if( vlc )
{
var count = vl c.playlist.items.count;
document.getElementById("item Count").value = " Items " + count + "&n bsp;";
}
}
function doRemoveItem(item)
{
var vlc = getVLC("vlc");
if( vlc )
vlc.playlist.items.remove(ite m);
}
function doPlaylistClearAll()
{
var vlc = getVLC("vlc");
if( vlc )
{
vlc.playlist.items.clear();
< br /> while( vlc.playlist.item s.count > 0)
{
//&nb sp;wait till playlist empties.
}
doItemCount();
}
}
function updateVolume(deltaVol)
{
var vlc = getVLC("vlc");
if( vlc )
{
vlc.audio.volume +=  ;deltaVol;
document.getElementById("volu meTextField").innerHTML = vlc.audio.volume+"%";
}
}
function formatTime(timeVal)
{
if( typeof timeVal != 'number'&nb sp;)
return "-:--:--";
var timeHour = Math.round(timeVal  ;/ 1000);
var timeSec = timeHour % 60;
if( timeSec < 10 )
timeSec = '0'+timeS ec;
timeHour = (timeHour - timeSec)/6 0;
var timeMin = timeHour % 60;
if( timeMin < 10 )
timeMin = '0'+timeM in;
timeHour = (timeHour - timeMin)/6 0;
if( timeHour > 0 )
return timeHour+":"+time Min+":"+timeSec;
else
return timeMin+":"+timeS ec;
}
// Old method of querying current state
// function doState() - depreceated
function doState()
{
var vlc = getVLC("vlc");
var newState = 0;
if( vlc )
newState = vlc.inpu t.state;
if( newState == 0 )
{
// current media&nb sp;has stopped
onEnd();
}
else if( newState == 1 )
{
// current media&nb sp;is openning/connecting
onOpen();
}
else if( newState == 2 )
{
// current media&nb sp;is buffering data
onBuffer();
}
else if( newState == 3 )
{
// current media&nb sp;is now playing
onPlay();
}
else if( newState == 4 )
{
// current media&nb sp;is now paused
onPause();
}
else if( newState == 5 )
{
// current media&nb sp;has stopped
onStop();
}
else if( newState == 6 )
{
// current media&nb sp;has ended
onEnd();
}
else if( newState == 7 )
{
// current media&nb sp;encountered error
!onerror!();
}
}
/* actions */
function doGo(targetURL)
{
var vlc = getVLC("vlc");
if( vlc )
{
vlc.playlist.items.clear();
< br /> while( vlc.playlist.item s.count > 0 )
{
//&nb sp;clear() may return before the playlist has&nbs p;actually been cleared
//&nb sp;just wait for it to finish its job
}
var options = [":rtsp-tcp"];
var itemId = v lc.playlist.add(targetURL,"",options);
options = [];
if( itemId != -1 )
{
//&nb sp;play MRL
vlc.p laylist.playItem(itemId);
}
else
{
alert ("cannot play at the moment !");
}
doItemCount();
}
}
function doAdd(targetURL)
{
var vlc = getVLC("vlc");
var options = [":vout-filter=deinterla ce", ":deinterlace-mode=linear"];
if( vlc )
{
vlc.playlist.add(targetURL,&n bsp;"", options);
options = [];
doItemCount();
}
}
function doPlayOrPause()
{
var vlc = getVLC("vlc");
if( vlc )
{
if( vlc.playlist.isPlayi ng && canPause )
{
vlc.p laylist.togglePause();
}
else if( vlc.playli st.items.count > 0 )
{
vlc.p laylist.play();
}
else
{
alert ('nothing to play !');
}
}
}
function doStop()
{
var vlc = getVLC("vlc");
if( vlc )
vlc.playlist.stop();
}
function doPlaySlower()
{
var vlc = getVLC("vlc");
if( vlc )
vlc.input.rate = vl c.input.rate / 2;
}
function doPlayFaster()
{
var vlc = getVLC("vlc");
if( vlc )
vlc.input.rate = vl c.input.rate * 2;
}
function doMarqueeOption(option, value)
{
var vlc = getVLC("vlc");
val = parseInt(value);
if( vlc )
{
if (option == 1)
vlc.v ideo.marquee.color = val;
if (option == 2)
vlc.v ideo.marquee.opacity = val;
if (option == 3)
vlc.v ideo.marquee.position = value;
if (option == 4)
vlc.v ideo.marquee.!refresh! = val;
if (option == 5)
vlc.v ideo.marquee.size = val;
if (option == 6)
vlc.v ideo.marquee.text = value;
if (option == 7)
vlc.v ideo.marquee.timeout = val;
if (option == 8)
vlc.v ideo.marquee.x = val;
if (option == 9)
vlc.v ideo.marquee.y = val;
}
}
function doLogoOption(option, value)
{
var vlc = getVLC("vlc");
if( vlc )
{
if (option == 1)
vlc.v ideo.logo.file(value);
if (option == 2)
vlc.v ideo.logo.position = value;
val = parseInt(valu e);
if (option == 3)
vlc.v ideo.logo.opacity = val;
if (option == 4)
vlc.v ideo.logo.repeat = val;
if (option == 5)
vlc.v ideo.logo.delay = val;
if (option == 6)
vlc.v ideo.logo.x = val;
if (option == 7)
vlc.v ideo.logo.y = val;
}
}
/* events */
function onOpen()
{
document.getElementById("state").innerHTML =&nbs p;"Opening...";
document.getElementById("PlayOrPause").value =&n bsp;"Pause";
}
function onBuffer()
{
document.getElementById("state").innerHTML =&nbs p;"Buffering...";
document.getElementById("PlayOrPause").value =&n bsp;"Pause";
}
function onPlay()
{
document.getElementById("state").innerHTML =&nbs p;"Playing...";
document.getElementById("PlayOrPause").value =&n bsp;"Pause";
onPlaying();
}
function onEnd()
{
document.getElementById("state").innerHTML =&nbs p;"End...";
}
var liveFeedText = ["Live", "((Live))", "(( Liv e ))", "(( Live ))"];
var liveFeedRoll = 0;
function onPlaying()
{
var vlc = getV LC("vlc");
var info = doc ument.getElementById("info");
if( vlc )
{
var&n bsp;mediaLen = vlc.input.length;
if(&n bsp;mediaLen > 0 )
{
  ; // seekable media
  ; info.innerHTML = formatTime(vlc.input.time)+"/"+fo rmatTime(mediaLen);
}
else
{
  ; // non-seekable "live" media
  ; liveFeedRoll = liveFeedRoll & 3;
  ; info.innerHTML = liveFeedText[liveFeedRoll++];
}
}
}
function onPause()
{
document.getElementById("state").innerHTML =&nbs p;"Paused...";
document.getElementById("PlayOrPause").value =&n bsp;" Play ";
}
function onStop()
{
var vlc = getVLC("vlc");
document.getElementById("info").innerHTML =  ;"-:--:--/-:--:--";
document.getElementById("state").innerHTML =&nbs p;"Stopped...";
document.getElementById("PlayOrPause").value =&n bsp;" Play ";
}
function !onerror!()
{
var vlc = getVLC("vlc");
document.getElementById("state").innerHTML =&nbs p;"Error...";
}
//-->
</SCRIPT>
</BODY>
</HTML>
|