Commit faebb471 authored by Damien Fouilleul's avatar Damien Fouilleul

- activex: cleanup, improved VB compatibility and new test.html file for new script APIs

parent 6c3e524b
......@@ -34,8 +34,11 @@ library AXVLC
{
// Forward declare all types defined in this typelib
interface IVLCControl;
interface IVLCAudio;
interface IVLCInput;
interface IVLCPlaylist;
interface ILibVLCControl;
interface IVLCVideo;
interface IVLCControl2;
dispinterface DVLCEvents;
importlib("stdole2.tlb");
......@@ -246,7 +249,7 @@ library AXVLC
HRESULT isPlaying([out, retval] VARIANT_BOOL* playing);
[helpstring("Add a playlist item.")]
HRESULT add([in] BSTR uri, [in] BSTR name, [in, optional] VARIANT options, [out, retval] int* item);
HRESULT add([in] BSTR uri, [in, optional] VARIANT name, [in, optional] VARIANT options, [out, retval] int* item);
[helpstring("Play/Resume the playlist.")]
HRESULT play();
......
No preview for this file type
......@@ -16,14 +16,29 @@ DEFINE_GUID(LIBID_AXVLC, 0xdf2bbe39, 0x40a8, 0x433b, 0xa2,0x79, 0x07,0x3f,0x48,0
typedef interface IVLCControl IVLCControl;
#endif
#ifndef __IVLCAudio_FWD_DEFINED__
#define __IVLCAudio_FWD_DEFINED__
typedef interface IVLCAudio IVLCAudio;
#endif
#ifndef __IVLCInput_FWD_DEFINED__
#define __IVLCInput_FWD_DEFINED__
typedef interface IVLCInput IVLCInput;
#endif
#ifndef __IVLCPlaylist_FWD_DEFINED__
#define __IVLCPlaylist_FWD_DEFINED__
typedef interface IVLCPlaylist IVLCPlaylist;
#endif
#ifndef __ILibVLCControl_FWD_DEFINED__
#define __ILibVLCControl_FWD_DEFINED__
typedef interface ILibVLCControl ILibVLCControl;
#ifndef __IVLCVideo_FWD_DEFINED__
#define __IVLCVideo_FWD_DEFINED__
typedef interface IVLCVideo IVLCVideo;
#endif
#ifndef __IVLCControl2_FWD_DEFINED__
#define __IVLCControl2_FWD_DEFINED__
typedef interface IVLCControl2 IVLCControl2;
#endif
#ifndef __DVLCEvents_FWD_DEFINED__
......@@ -751,11 +766,6 @@ interface DVLCEvents {
#endif /* __DVLCEvents_DISPINTERFACE_DEFINED__ */
#ifndef __IVLCAudio_FWD_DEFINED__
#define __IVLCAudio_FWD_DEFINED__
typedef interface IVLCAudio IVLCAudio;
#endif
/*****************************************************************************
* IVLCAudio interface
*/
......@@ -916,11 +926,6 @@ void __RPC_STUB IVLCAudio_toggleMute_Stub(
#endif /* __IVLCAudio_INTERFACE_DEFINED__ */
#ifndef __IVLCInput_FWD_DEFINED__
#define __IVLCInput_FWD_DEFINED__
typedef interface IVLCInput IVLCInput;
#endif
/*****************************************************************************
* IVLCInput interface
*/
......@@ -1181,7 +1186,7 @@ interface IVLCPlaylist : public IDispatch
virtual HRESULT STDMETHODCALLTYPE add(
BSTR uri,
BSTR name,
VARIANT name,
VARIANT options,
int* item) = 0;
......@@ -1268,7 +1273,7 @@ typedef struct IVLCPlaylistVtbl {
HRESULT (STDMETHODCALLTYPE *add)(
IVLCPlaylist* This,
BSTR uri,
BSTR name,
VARIANT name,
VARIANT options,
int* item);
......@@ -1349,7 +1354,7 @@ void __RPC_STUB IVLCPlaylist_get_isPlaying_Stub(
HRESULT CALLBACK IVLCPlaylist_add_Proxy(
IVLCPlaylist* This,
BSTR uri,
BSTR name,
VARIANT name,
VARIANT options,
int* item);
void __RPC_STUB IVLCPlaylist_add_Stub(
......@@ -1418,11 +1423,6 @@ void __RPC_STUB IVLCPlaylist_removeItem_Stub(
#endif /* __IVLCPlaylist_INTERFACE_DEFINED__ */
#ifndef __IVLCVideo_FWD_DEFINED__
#define __IVLCVideo_FWD_DEFINED__
typedef interface IVLCVideo IVLCVideo;
#endif
/*****************************************************************************
* IVLCVideo interface
*/
......@@ -1569,11 +1569,6 @@ void __RPC_STUB IVLCVideo_get_height_Stub(
#endif /* __IVLCVideo_INTERFACE_DEFINED__ */
#ifndef __IVLCControl2_FWD_DEFINED__
#define __IVLCControl2_FWD_DEFINED__
typedef interface IVLCControl2 IVLCControl2;
#endif
/*****************************************************************************
* IVLCControl2 interface
*/
......
......@@ -36,7 +36,7 @@ public:
e(VLCEnum<CONNECTDATA>(IID_IEnumConnections, v))
{ e.setRetainOperation((VLCEnum<CONNECTDATA>::retainer)&retain); };
VLCEnumConnections(const VLCEnumConnections &vlcEnum) : e(vlcEnum.e) {};
VLCEnumConnections(const VLCEnumConnections &vlcEnum) : IEnumConnections(), e(vlcEnum.e) {};
virtual ~VLCEnumConnections() {};
......@@ -184,7 +184,7 @@ public:
e(VLCEnum<LPCONNECTIONPOINT>(IID_IEnumConnectionPoints, v))
{ e.setRetainOperation((VLCEnum<LPCONNECTIONPOINT>::retainer)&retain); };
VLCEnumConnectionPoints(const VLCEnumConnectionPoints &vlcEnum) : e(vlcEnum.e) {};
VLCEnumConnectionPoints(const VLCEnumConnectionPoints &vlcEnum) : IEnumConnectionPoints(), e(vlcEnum.e) {};
virtual ~VLCEnumConnectionPoints() {};
......
......@@ -36,7 +36,7 @@ public:
VLCEnumFORMATETC(vector<FORMATETC> &v) :
e(VLCEnum<FORMATETC>(IID_IEnumFORMATETC, v)) {};
VLCEnumFORMATETC(const VLCEnumFORMATETC &vlcEnum) : e(vlcEnum.e) {};
VLCEnumFORMATETC(const VLCEnumFORMATETC &vlcEnum) : IEnumFORMATETC(), e(vlcEnum.e) {};
virtual ~VLCEnumFORMATETC() {};
// IUnknown methods
......
......@@ -57,8 +57,7 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
*ppv = NULL;
if( (CLSID_VLCPlugin == rclsid)
|| (CLSID_VLCPlugin2 == rclsid) )
if( CLSID_VLCPlugin2 == rclsid )
{
VLCPluginClass *plugin = new VLCPluginClass(&i_class_ref, h_instance, rclsid);
hr = plugin->QueryInterface(riid, ppv);
......@@ -158,14 +157,20 @@ STDAPI DllUnregisterServer(VOID)
SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(PROGID_STR));
UnregisterProgID(CLSID_VLCPlugin, 1);
UnregisterProgID(CLSID_VLCPlugin, 2);
UnregisterProgID(CLSID_VLCPlugin2, 1);
return S_OK;
};
static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int version, const char *path, size_t pathLen)
static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int version, BOOL isDefault, const char *path, size_t pathLen)
{
char progId[sizeof(PROGID_STR)+16];
sprintf(progId, "%s.%u", PROGID_STR, version);
char description[sizeof(DESCRIPTION)+16];
sprintf(description, "%s v%u", DESCRIPTION, version);
HKEY hClassKey;
{
LPCSTR psz_CLSID = CStrFromGUID(rclsid);
......@@ -173,13 +178,43 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
if( NULL == psz_CLSID )
return E_OUTOFMEMORY;
HKEY hProgKey = keyCreate(HKEY_CLASSES_ROOT, progId);
if( NULL != hProgKey )
{
// default key value
keySetDef(hProgKey, description);
keyClose(keySetDef(keyCreate(hProgKey, "CLSID"),
psz_CLSID,
GUID_STRLEN));
//hSubKey = keyClose(keyCreate(hBaseKey, "Insertable"));
RegCloseKey(hProgKey);
}
if( isDefault )
{
hProgKey = keyCreate(HKEY_CLASSES_ROOT, PROGID_STR);
if( NULL != hProgKey )
{
// default key value
keySetDef(hProgKey, description);
keyClose(keySetDef(keyCreate(hProgKey, "CLSID"),
psz_CLSID,
GUID_STRLEN));
keyClose(keySetDef(keyCreate(hProgKey, "CurVer"),
progId));
}
}
hClassKey = keyCreate(hParent, psz_CLSID);
CoTaskMemFree((void *)psz_CLSID);
}
if( NULL != hClassKey )
{
// default key value
keySetDef(hClassKey, DESCRIPTION, sizeof(DESCRIPTION));
keySetDef(hClassKey, description);
// Control key value
keyClose(keyCreate(hClassKey, "Control"));
......@@ -223,13 +258,9 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
keyClose(keyCreate(hClassKey, "Programmable"));
// ProgID key value
{
char progId[sizeof(PROGID_STR)+16];
sprintf(progId, "%s.%u", PROGID_STR, version);
keyClose(keySetDef(keyCreate(hClassKey,
TEXT("ProgID")),
progId));
}
keyClose(keySetDef(keyCreate(hClassKey,
TEXT("ProgID")),
progId));
// VersionIndependentProgID key value
keyClose(keySetDef(keyCreate(hClassKey,
......@@ -237,13 +268,9 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
PROGID_STR, sizeof(PROGID_STR)));
// Version key value
{
char ver[32];
sprintf(ver, "%u.0", version);
keyClose(keySetDef(keyCreate(hClassKey,
"Version"),
ver));
}
keyClose(keySetDef(keyCreate(hClassKey,
"Version"),
"1.0"));
// TypeLib key value
LPCSTR psz_LIBID = CStrFromGUID(LIBID_AXVLC);
......@@ -259,61 +286,6 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
return S_OK;
}
static HRESULT RegisterProgID(REFCLSID rclsid, unsigned int version)
{
LPCSTR psz_CLSID = CStrFromGUID(rclsid);
if( NULL == psz_CLSID )
return E_OUTOFMEMORY;
char progId[sizeof(PROGID_STR)+16];
sprintf(progId, "%s.%u", PROGID_STR, version);
HKEY hBaseKey = keyCreate(HKEY_CLASSES_ROOT, progId);
if( NULL != hBaseKey )
{
// default key value
keySetDef(hBaseKey, DESCRIPTION, sizeof(DESCRIPTION));
keyClose(keySetDef(keyCreate(hBaseKey, "CLSID"),
psz_CLSID,
GUID_STRLEN));
//hSubKey = keyClose(keyCreate(hBaseKey, "Insertable"));
RegCloseKey(hBaseKey);
}
CoTaskMemFree((void *)psz_CLSID);
return S_OK;
}
static HRESULT RegisterDefaultProgID(REFCLSID rclsid, unsigned int version)
{
LPCSTR psz_CLSID = CStrFromGUID(rclsid);
if( NULL == psz_CLSID )
return E_OUTOFMEMORY;
HKEY hBaseKey = keyCreate(HKEY_CLASSES_ROOT, PROGID_STR);
if( NULL != hBaseKey )
{
// default key value
keySetDef(hBaseKey, DESCRIPTION, sizeof(DESCRIPTION));
keyClose(keySetDef(keyCreate(hBaseKey, "CLSID"),
psz_CLSID,
GUID_STRLEN));
char progId[sizeof(PROGID_STR)+16];
sprintf(progId, "%s.%u", PROGID_STR, version);
keyClose(keySetDef(keyCreate(hBaseKey, "CurVer"),
progId));
}
CoTaskMemFree((void *)psz_CLSID);
}
STDAPI DllRegisterServer(VOID)
{
DllUnregisterServer();
......@@ -328,17 +300,11 @@ STDAPI DllRegisterServer(VOID)
if( ERROR_SUCCESS != RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID", 0, KEY_CREATE_SUB_KEY, &hBaseKey) )
return SELFREG_E_CLASS;
RegisterClassID(hBaseKey, CLSID_VLCPlugin, 1, DllPath, DllPathLen);
RegisterClassID(hBaseKey, CLSID_VLCPlugin2, 2, DllPath, DllPathLen);
RegisterClassID(hBaseKey, CLSID_VLCPlugin, 1, FALSE, DllPath, DllPathLen);
RegisterClassID(hBaseKey, CLSID_VLCPlugin2, 2, TRUE, DllPath, DllPathLen);
RegCloseKey(hBaseKey);
RegisterProgID(CLSID_VLCPlugin, 1);
RegisterProgID(CLSID_VLCPlugin2, 2);
/* default control */
RegisterDefaultProgID(CLSID_VLCPlugin2, 2);
// indicate which component categories we support
ICatRegister *pcr;
if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr,
......
......@@ -51,10 +51,6 @@ using namespace std;
////////////////////////////////////////////////////////////////////////
//class factory
// {E23FE9C6-778E-49d4-B537-38FCDE4887D8}
//const GUID CLSID_VLCPlugin =
// { 0xe23fe9c6, 0x778e, 0x49d4, { 0xb5, 0x37, 0x38, 0xfc, 0xde, 0x48, 0x87, 0xd8 } };
static LRESULT CALLBACK VLCInPlaceClassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch( uMsg )
{
......@@ -340,7 +336,9 @@ STDMETHODIMP VLCPlugin::QueryInterface(REFIID riid, void **ppv)
else if( IID_IObjectSafety == riid )
*ppv = reinterpret_cast<LPVOID>(vlcObjectSafety);
else if( IID_IDispatch == riid )
*ppv = reinterpret_cast<LPVOID>(vlcControl);
*ppv = (CLSID_VLCPlugin2 == getClassID()) ?
reinterpret_cast<LPVOID>(vlcControl2) :
reinterpret_cast<LPVOID>(vlcControl);
else if( IID_IVLCControl == riid )
*ppv = reinterpret_cast<LPVOID>(vlcControl);
else if( IID_IVLCControl2 == riid )
......@@ -590,7 +588,7 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
}
#if 0
ppsz_argv[0] = "C:\\cygwin\\home\\Damien_Fouilleul\\dev\\videolan\\vlc-trunk\\vlc";
ppsz_argv[0] = "C:\\cygwin\\home\\damienf\\vlc-trunk\\vlc";
#endif
// make sure plugin isn't affected with VLC single instance mode
......@@ -624,11 +622,11 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
{
/*
** VLC default threading mechanism is designed to be as compatible
** with POSIX as possible, however when debugged on win32, threads
** with POSIX as possible. However when debugged on win32, threads
** lose signals and eventually VLC get stuck during initialization.
** threading support can be configured to be more debugging friendly
** but it will be less compatible with POSIX.
** This is done by initializing with the following options
** This is done by initializing with the following options:
*/
ppsz_argv[ppsz_argc++] = "--fast-mutex";
ppsz_argv[ppsz_argc++] = "--win9x-cv-method=1";
......
<HTML>
<TITLE>VLC ActiveX plugin test page</TITLE>
<BODY>
<TABLE>
<TR><TD colspan="2">
MRL:
<INPUT size="90" name="targetTextField" value="">
<INPUT type=submit value="Go" onClick="doGo(targetTextField.value);">
</TD></TR>
<TR><TD colspan="2">
<!--
Insert VideoLAN.VLCPlugin.1 activex control
-->
<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,4,0"
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="StartTime" value="0" />
</OBJECT>
</TD></TR>
<TR><TD>
<!--
Insert MSComctlLib.Slider.2 activex control
-->
<OBJECT classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628"
width="540"
height="20"
id="slider"
events="True">
<param name="TickStyle" value="3" />
<param name="Min" value="0" />
<param name="Max" value="0" />
<param name="Value" value="0" />
<param name="Enabled" value="False" />
</OBJECT>
</TD><TD width="15%">
<DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
</TD></TR>
<TR><TD colspan="2">
<INPUT type=button id="PlayOrPause" value=" Play " onClick='doPlayOrPause()'>
<INPUT type=button value="Stop" onClick='document.vlc.stop();'>
&nbsp;
<INPUT type=button value=" << " onClick='document.vlc.playSlower();'>
<INPUT type=button value=" >> " onClick='document.vlc.playFaster();'>
&nbsp;
<INPUT type=button value="Show" onClick='document.vlc.Visible = true;'>
<INPUT type=button value="Hide" onClick='document.vlc.Visible = false;'>
&nbsp;
<INPUT type=button value="Version" onClick='alert(document.vlc.VersionInfo);'>
<SPAN style="text-align:center">Volume:</SPAN>
<INPUT type=button value=" - " onClick='updateVolume(-10)'>
<SPAN id="volumeTextField" style="text-align: center">--</SPAN>
<INPUT type=button value=" + " onClick='updateVolume(+10)'>
<INPUT type=button value="Mute" onClick='document.vlc.toggleMute();'>
</TD>
</TR>
</TABLE>
<SCRIPT LANGUAGE="JScript">
<!--
var sliderTimerId = 0;
var sliderScrolling = false;
document.onreadystatechange=onVLCStateChange;
function onVLCStateChange()
{
if( document.readyState == 'complete' )
{
updateVolume(0);
}
};
function updateVolume(deltaVol)
{
vlc.Volume += deltaVol;
volumeTextField.innerText = vlc.Volume+"%";
};
function formatTime(timeVal)
{
var timeHour = timeVal;
var timeSec = timeHour % 60;
if( timeSec < 10 )
timeSec = '0'+timeSec;
timeHour = (timeHour - timeSec)/60;
var timeMin = timeHour % 60;
if( timeMin < 10 )
timeMin = '0'+timeMin;
timeHour = (timeHour - timeMin)/60;
if( timeHour > 0 )
return timeHour+":"+timeMin+":"+timeSec;
else
return timeMin+":"+timeSec;
};
function onPlay()
{
document.getElementById("PlayOrPause").value = "Pause";
};
function onPause()
{
document.getElementById("PlayOrPause").value = " Play ";
};
function onStop()
{
if( slider.Enabled )
{
slider.Value = slider.Min;
slider.Enabled = false;
}
info.innerText = "-:--:--/-:--:--";
document.getElementById("PlayOrPause").value = " Play ";
};
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))");
var liveFeedRoll = 0;
function doUpdate()
{
if( vlc.Playing )
{
if( ! sliderScrolling )
{
if( vlc.Length > 0 )
{
// seekable stream
slider.Enabled = true;
slider.Max = vlc.Length;
slider.Value = vlc.Time;
info.innerText = formatTime(vlc.Time)+"/"+formatTime(vlc.Length);
document.getElementById("PlayOrPause").Enabled = true;
}
else {
// non-seekable "live" stream
if( slider.Enabled )
{
slider.Value = slider.Min;
slider.Enabled = false;
}
liveFeedRoll = liveFeedRoll & 3;
info.innerText = liveFeedText[liveFeedRoll++];
}
}
sliderTimerId = setTimeout("doUpdate()", 1000);
}
else
{
onStop();
sliderTimerId = 0;
}
};
function doGo(targetURL)
{
var options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear");
document.vlc.addTarget(targetURL, options, 4+8, -666);
};
function doPlayOrPause()
{
if( document.vlc.playing )
{
document.vlc.pause();
}
else
{
document.vlc.play();
}
};
function vlc::Play()
{
if( ! sliderTimerId )
{
sliderTimerId = setTimeout("doUpdate()", 1000);
}
onPlay();
};
function vlc::Pause()
{
if( sliderTimerId )
{
clearTimeout(sliderTimerId)
sliderTimerId = 0;
}
onPause();
};
function vlc::Stop()
{
if( sliderTimerId )
{
clearTimeout(sliderTimerId)
sliderTimerId = 0;
}
onStop();
};
function slider::Scroll()
{
slider.Text = formatTime(slider.Value);
info.innerText = slider.Text+"/"+formatTime(vlc.Length);
if( vlc.Time != slider.Value )
{
vlc.Time = slider.Value;
}
};
function slider::Change()
{
if( sliderScrolling )
{
sliderScrolling = false;
}
else if( vlc.Time != slider.Value )
{
vlc.Time = slider.Value;
}
};
//-->
</SCRIPT>
</BODY>
</HTML>
<HTML>
<TITLE>VLC ActiveX plugin test page</TITLE>
<BODY>
<TABLE>
<TR><TD colspan="2">
MRL:
<INPUT size="90" id="targetTextField" value="">
<INPUT type=submit value="Go" onClick="doGo(document.getElementById('targetTextField').value);">
</TD></TR>
<TR><TD colspan="2">
<!--
Insert VideoLAN.VLCPlugin.2 activex control
-->
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0"
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="StartTime" value="0" />
</OBJECT>
</TD></TR>
<TR><TD>
<!--
Insert MSComctlLib.Slider.2 activex control
-->
<OBJECT classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628"
width="540"
height="20"
id="slider"
events="True">
<param name="TickStyle" value="3" />
<param name="Min" value="0" />
<param name="Max" value="0" />
<param name="Value" value="0" />
<param name="Enabled" value="False" />
</OBJECT>
</TD><TD width="15%">
<DIV id="info" style="text-align:center">-:--:--/-:--:--</DIV>
</TD></TR>
<TR><TD colspan="2">
<INPUT type=button id="PlayOrPause" value=" Play " onClick='doPlayOrPause()'>
<INPUT type=button value="Stop" onClick='document.getElementById("vlc").playlist.stop();'>
&nbsp;
<INPUT type=button value=" << " onClick='doPlaySlower();'>
<INPUT type=button value=" >> " onClick='doPlayFaster();'>
&nbsp;
<INPUT type=button value="Show" onClick='document.getElementById("vlc").Visible = true;'>
<INPUT type=button value="Hide" onClick='document.getElementById("vlc").Visible = false;'>
&nbsp;
<INPUT type=button value="Version" onClick='alert(document.getElementById("vlc").VersionInfo);'>
<SPAN style="text-align:center">Volume:</SPAN>
<INPUT type=button value=" - " onClick='updateVolume(-10)'>
<SPAN id="volumeTextField" style="text-align: center">--</SPAN>
<INPUT type=button value=" + " onClick='updateVolume(+10)'>
<INPUT type=button value="Mute" onClick='document.getElementById("vlc").audio.toggleMute();'>
</TD>
</TR>
</TABLE>
<SCRIPT LANGUAGE="JScript">
<!--
var sliderTimerId = 0;
var sliderScrolling = false;
document.onreadystatechange=onVLCStateChange;
function onVLCStateChange()
{
if( document.readyState == 'complete' )
{
updateVolume(0);
}
};
function updateVolume(deltaVol)
{
var vlc = document.getElementById("vlc");
vlc.audio.volume += deltaVol;
document.getElementById("volumeTextField").innerHTML = vlc.audio.volume+"%";
};
function formatTime(timeVal)
{
var timeHour = timeVal;
var timeSec = timeHour % 60;
if( timeSec < 10 )
timeSec = '0'+timeSec;
timeHour = (timeHour - timeSec)/60;
var timeMin = timeHour % 60;
if( timeMin < 10 )
timeMin = '0'+timeMin;
timeHour = (timeHour - timeMin)/60;
if( timeHour > 0 )
return timeHour+":"+timeMin+":"+timeSec;
else
return timeMin+":"+timeSec;
};
function onPlay()
{
document.getElementById("PlayOrPause").value = "Pause";
};
function onPause()
{
document.getElementById("PlayOrPause").value = " Play ";
};
function onStop()
{
if( slider.Enabled )
{
slider.Value = slider.Min;
slider.Enabled = false;
}
info.innerText = "-:--:--/-:--:--";
document.getElementById("PlayOrPause").value = " Play ";
};
var liveFeedText = new Array("Live", "((Live))", "(( Live ))", "(( Live ))");
var liveFeedRoll = 0;
function doUpdate()
{
var vlc = document.getElementById("vlc");
if( vlc.playlist.isPlaying )
{
if( ! sliderScrolling )
{
if( vlc.input.length > 0 )
{
// seekable stream
slider.Enabled = true;
slider.Max = vlc.input.length;
slider.Value = vlc.input.time;
info.innerText = formatTime(vlc.input.time)+"/"+formatTime(vlc.input.length);
document.getElementById("PlayOrPause").Enabled = true;
}
else {
// non-seekable "live" stream
if( slider.Enabled )
{
slider.Value = slider.Min;
slider.Enabled = false;
}
liveFeedRoll = liveFeedRoll & 3;
info.innerText = liveFeedText[liveFeedRoll++];
}
}
sliderTimerId = setTimeout("doUpdate()", 1000);
}
else
{
onStop();
sliderTimerId = 0;
}
};
function doGo(targetURL)
{