Commit 18631b59 authored by Damien Fouilleul's avatar Damien Fouilleul

Documentation/Example update

parent feb33628
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
The VLC ActiveX Control has been primary designed to work with Internet Explorer. The VLC ActiveX Control has been primary designed to work with Internet Explorer.
however it may also work with Visual Basic and/or .NET however it may also work with Visual Basic and/or .NET
Please note, that this code does not rely upon MFC/ATL, hence good compatibility Please note, that this code does not rely upon Microsoft MFC/ATL code,
is not guaranteed. hence good compatibility is not guaranteed.
== Compiling == == Compiling ==
The Active Control should compile without any glitches as long as you have the latest The ActiveX Control should compile without any glitches as long as you have the latest
version of mingw gcc and headers. However, In order to script the ActiveX Control version of mingw gcc and headers. However, In order to script the ActiveX Control
on Internet Explorer, a type library is required. on Internet Explorer, a type library is required.
...@@ -31,22 +31,47 @@ export MIDL="midl" ...@@ -31,22 +31,47 @@ export MIDL="midl"
if you are cross-compiling on Linux, you may be able to use 'widl' which is part of if you are cross-compiling on Linux, you may be able to use 'widl' which is part of
the WINE project (http://www.winehq.com), however I have not tested it. the WINE project (http://www.winehq.com), however I have not tested it.
== Debugging ==
the ActiveX control is compiled with verbose output by default. However you will
need to launch Internet Explorer from a Cygwin shell to see the output.
Debugging the ActiveX control DLL with GNU GDB can be difficult. Fortunately,
the ActiveX control can also be compiled as an executable rather than a DLL.
In ActiveX terms, this is called a local server.
The advantage of a local server is that it will never crash its client,
i.e Internet Explorer, if itself is crashing.
The build system does not currently allow to create an executable version of
the ActiveX control, you will need to manually define the BUILD_LOCALSERVER
pre-processor variable and modify the Makefile to exclude the '-shared' option
at the linking stage. Once this is done, you just need to launch axvlc.exe to
have a working Activex control. Please note, that executable version of the
ActiveX control will override any settings required for the DLL version, which
will no longer work until you (re)register it as shown in the following section
== Local Install == == Local Install ==
The ActiveX control is built as a DLL file, which is the only file that needs be The VLC NSIS installer will install the ActiveX Control without requiring any
distributed and it may be installed anywhere on the target machine as long as further manual intervention, but for people who like to live on the edge, here
its path is specified within your PATH environment variable. Typically, you would are the steps you need to perform once you have built the ActiveX Control.
install it into your WINDOWS directory.
if the control needs other VLC plugins, you will need to have VLC installed The ActiveX control DLL file may be copied anywhere on the target machine,
on your system, otherwise make sure that the plugin path is set in the registry but before you can use the control, you will need to register it with Windows
as indicated below by using the REGSVR32 command, as per following example:
REGSVR32 C:\WINDOWS\AXVLC.DLL
if the control needs to use external VLC plugins (i.e other than built-in ones),
make sure that the plugin path is set in the registry as per following example:
[HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC] [HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC]
InstallDir="path\\dir\\" InstallDir="C:\Program Files\VideoLAN\VLC"
The InstallDir must contain the 'plugins' directory.
WARNING: The plugins version must also match the ActiveX control version, WARNING: Both control and plugins must come from the same build source tree.
otherwise it may crash while attempting to load incompatible plugins Otherwise, at best, the control will not play any content, at worse
it may crash Internet Explorer while attempting to load incompatible plugins.
== Internet Install == == Internet Install ==
...@@ -55,11 +80,12 @@ it is packaged up in a CAB file. The following link explains how to achieve this ...@@ -55,11 +80,12 @@ it is packaged up in a CAB file. The following link explains how to achieve this
http://msdn.microsoft.com/workshop/components/activex/packaging.asp http://msdn.microsoft.com/workshop/components/activex/packaging.asp
For convenience, I have provide a sample axvlc.INF file, which installs the ActiveX Control For convenience, I have provided a sample axvlc.INF file, which assumes that the VLC
into the WINDOWS directory, feel free to adapt it to your need. NSIS Installer has been packaged up a CAB file called AXVLC.CAB.
WARNING: For remote install, the ActiveX Control should be built with all required VLC The ActiveX Control DLL file can also be distributed by itself if it has been
plugins built-in. compiled with built-in VLC plugins; check developer information for more
information on built-in plugins.
regards, regards,
Damien Fouilleul <Damien dot Fouilleul at laposte dot net> Damien Fouilleul <Damien dot Fouilleul at laposte dot net>
......
<HTML> <HTML>
<TITLE>VLC ActiveX plugin test page</TITLE> <TITLE>VLC ActiveX plugin test page</TITLE>
<BODY> <BODY>
<TABLE>
<TR><TD colspan="2">
MRL:
<INPUT size="80" name="targetTextField" value="">
<INPUT type=submit value="Go" onClick="go(targetTextField.value);">
</TD></TR>
<TR><TD colspan="2">
<!--
Insert VideoLAN.VLCPlugin.1 activex control
-->
<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" codebase="axvlc.cab"
width="640" height="480" id="vlc" events="True">
<param name="Src" value="" />
<param name="ShowDisplay" value="True" />
<param name="Loop" value="False" />
<param name="AutoPlay" value="False" />
</OBJECT>
</TD></TR>
<TR><TD colspan="2">
<!--
Insert MSComctlLib.Slider.2 activex control
-->
<OBJECT classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628"
width="640" 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>
<SCRIPT LANGUAGE="JScript"> <SCRIPT LANGUAGE="JScript">
<!-- <!--
var sliderTimerId = 0; var sliderTimerId = 0;
...@@ -40,10 +10,17 @@ function formatTime(timeVal) ...@@ -40,10 +10,17 @@ function formatTime(timeVal)
{ {
var timeHour = timeVal; var timeHour = timeVal;
var timeSec = timeHour % 60; var timeSec = timeHour % 60;
if( timeSec < 10 )
timeSec = '0'+timeSec;
timeHour = (timeHour - timeSec)/60; timeHour = (timeHour - timeSec)/60;
var timeMin = timeHour % 60; var timeMin = timeHour % 60;
if( timeMin < 10 )
timeMin = '0'+timeMin;
timeHour = (timeHour - timeMin)/60; timeHour = (timeHour - timeMin)/60;
return timeHour+":"+timeMin+":"+timeSec; if( timeHour > 0 )
return timeHour+":"+timeMin+":"+timeSec;
else
return timeMin+":"+timeSec;
}; };
function go(targetURL) function go(targetURL)
{ {
...@@ -51,10 +28,10 @@ function go(targetURL) ...@@ -51,10 +28,10 @@ function go(targetURL)
document.vlc.addTarget(targetURL, options, 4+8, -666); document.vlc.addTarget(targetURL, options, 4+8, -666);
if( ! sliderTimerId ) if( ! sliderTimerId )
{ {
sliderTimerId = setTimeout("updateSlider()", 1000); sliderTimerId = setTimeout("updateInterface()", 1000);
} }
}; };
function updateSlider() function updateInterface()
{ {
if( ! sliderScrolling ) if( ! sliderScrolling )
{ {
...@@ -65,30 +42,61 @@ function updateSlider() ...@@ -65,30 +42,61 @@ function updateSlider()
slider.Value = vlc.Time; slider.Value = vlc.Time;
info.innerText = formatTime(vlc.Time)+"/"+formatTime(vlc.Length); info.innerText = formatTime(vlc.Time)+"/"+formatTime(vlc.Length);
} }
else else if( slider.Enabled )
{ {
if( slider.Enabled ) slider.Enabled = false;
{ slider.Value = slider.Min;
slider.Enabled = false; info.innerText = "--:--/--:--";
slider.Value = slider.Min;
}
info.innerText = "---/---";
} }
} }
if( vlc.Playing ) if( vlc.Playing )
{ {
sliderTimerId = setTimeout("updateSlider()", 1000); sliderTimerId = setTimeout("updateInterface()", 1000);
} }
else else
{ {
sliderTimerId = 0; sliderTimerId = 0;
} }
}; };
//-->
</SCRIPT>
<TABLE>
<TR><TD colspan="2">
MRL:
<INPUT size="90" name="targetTextField" value="">
<INPUT type=submit value="Go" onClick="go(targetTextField.value);">
</TD></TR>
<TR><TD colspan="2">
<!--
Insert VideoLAN.VLCPlugin.1 activex control
-->
<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" codebase="axvlc.cab"
width="640" height="480" id="vlc" events="True">
<param name="Src" value="" />
<param name="ShowDisplay" value="True" />
<param name="Loop" value="False" />
<param name="AutoPlay" value="False" />
</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>
<SCRIPT LANGUAGE="JScript">
function vlc::play() function vlc::play()
{ {
if( ! sliderTimerId ) if( ! sliderTimerId )
{ {
sliderTimerId = setTimeout("updateSlider()", 1000); sliderTimerId = setTimeout("updateInterface()", 1000);
} }
}; };
function vlc::pause() function vlc::pause()
...@@ -109,7 +117,7 @@ function vlc::stop() ...@@ -109,7 +117,7 @@ function vlc::stop()
{ {
slider.Value = slider.Min; slider.Value = slider.Min;
slider.Enabled = false; slider.Enabled = false;
info.innerText = ""; info.innerText = "--:--/--:--";
} }
} }
}; };
...@@ -121,7 +129,6 @@ function slider::Scroll() ...@@ -121,7 +129,6 @@ function slider::Scroll()
{ {
vlc.Time = slider.Value; vlc.Time = slider.Value;
} }
sliderScrolling = true;
}; };
function slider::Change() function slider::Change()
{ {
...@@ -136,8 +143,10 @@ function slider::Change() ...@@ -136,8 +143,10 @@ function slider::Change()
}; };
//--> //-->
</SCRIPT> </SCRIPT>
</TD><TD width="15%">
<DIV id="info" style="text-align:right">--:--/--:--</DIV>
</TD></TR> </TD></TR>
<TR><TD> <TR><TD colspan="2">
<INPUT type=button value="Play" onClick='document.vlc.play();'> <INPUT type=button value="Play" onClick='document.vlc.play();'>
<INPUT type=button value="Stop" onClick='document.vlc.stop();'> <INPUT type=button value="Stop" onClick='document.vlc.stop();'>
<INPUT type=button value="Pause" onClick='document.vlc.pause();'> <INPUT type=button value="Pause" onClick='document.vlc.pause();'>
...@@ -147,8 +156,6 @@ function slider::Change() ...@@ -147,8 +156,6 @@ function slider::Change()
<INPUT type=button value="Show" onClick='document.vlc.Visible = true;'> <INPUT type=button value="Show" onClick='document.vlc.Visible = true;'>
<INPUT type=button value="Hide" onClick='document.vlc.Visible = false;'> <INPUT type=button value="Hide" onClick='document.vlc.Visible = false;'>
<INPUT type=button value="Version" onClick='alert(document.vlc.VersionInfo);'> <INPUT type=button value="Version" onClick='alert(document.vlc.VersionInfo);'>
</TD><TD width="20%">
<DIV id="info" style="text-align:right"></DIV>
</TD></TR> </TD></TR>
</TABLE> </TABLE>
</BODY> </BODY>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment