README.TXT 10.1 KB
Newer Older
1 2
== ACTIVEX Control for VLC ==

3 4 5 6
The VLC ActiveX Control has been primary designed to work with Internet
Explorer. However it may also work with Visual Basic and/or .NET. Please
note, that this code does not rely upon Microsoft MFC/ATL code, hence
good compatibility is not guaranteed.
7

8
I. Compiling
9

10 11
The ActiveX Control should compile without any glitches as long as you
have the latest version of mingw gcc and headers.
12

13 14 15 16 17 18
In order to script the ActiveX Control on Internet Explorer, a type
library is required. This type library is usually generated from an IDL
file using Microsoft MIDL compiler. Therefore, for convenience I have
checked in the output of the MIDL compiler in the repository so that you
will only need the MIDL compiler if you change axvlc.idl. the generated
files are as follow:
19 20 21 22 23

axvlc_idl.c
axvlc_idl.h
axvlc.tlb

24 25 26 27
To use the MIDL compiler on cygwin, you will need to set some
environment variables before configuring vlc. If you have a copy of
'Microsoft Visual C++ 6.0' installed, the following settings are
correct:
28 29 30 31 32

export PATH=$PATH:"/cygdrive/c/Program Files/Microsoft Visual Studio/COMMON/MSDev98/Bin":"/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/Bin"
export INCLUDE='C:\Program Files\Microsoft Visual Studio\VC98\Include'
export MIDL="midl"

33 34 35 36 37
If you are cross-compiling on Linux, you can use 'widl' which is part of
the WINE project (http://www.winehq.com). At leat wine-dev-0.9.57 works,
the comand line to compile IDL should looks like the following :

widl -I/usr/include/wine/windows/ \
38
	-h -H axvlc_idl.h -t -T axvlc.tlb -u -U axvlc_idl.c axvlc.idl
39 40 41

NOTE: widl breaks compatibility with Visual Basic. If that is important
to you then you must use midl.
42

43
II. Debugging
44

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
The ActiveX control is compiled with verbose output by default, but you
will need to launch Internet Explorer from a Cygwin shell to see the
output. Alternatively, the plugin will also use the VLC preferences, so
if you enable the file logging interface through the player and save the
preferences, the control will automatically log its verbose output into
the designated file.

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, even if the local server crashes. 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, 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
65

66
III. Local Install
67

68 69 70 71
The VLC NSIS installer will install the ActiveX Control without
requiring any further manual intervention, but for people who like to
live on the edge, here are the steps you need to perform once you have
built the ActiveX Control.
72

73 74 75
The ActiveX control DLL file may be copied anywhere on the target
machine, but before you can use the control, you will need to register
it with Windows by using the REGSVR32 command, as per following example:
76 77 78

REGSVR32 C:\WINDOWS\AXVLC.DLL

79 80 81
If the control needs to use external VLC plugins (i.e other than the
built-in ones), make sure that the plugin path is set in the registry as
per following example:
82 83

[HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC]
84 85
InstallDir="C:\Program Files\VideoLAN\VLC"

Damien Fouilleul's avatar
Damien Fouilleul committed
86
The InstallDir must be the parent directory of the 'plugins' directory.
87

88 89 90 91
WARNING: Both control and plugins must come from the same source build
tree. Otherwise, at best, the control will not play any content,
at worse it may crash Internet Explorer while attempting to load
incompatible plugins.
92

93
IV. Internet Install
94

95 96 97
The activex control may be installed from a remote through Internet
Installer if it is packaged up in a CAB file. The following link
explains how to achieve this
98 99 100

http://msdn.microsoft.com/workshop/components/activex/packaging.asp

101 102 103
For convenience, I have provided a sample axvlc.INF file, which assumes
that the VLC NSIS Installer has been packaged up a CAB file called
AXVLC.CAB.
104

105 106 107
The ActiveX Control DLL file can also be distributed by itself if it has
been compiled with built-in VLC plugins; check developer information for
more information on built-in plugins.
108

109 110 111 112
V. Controlling the plugin

1) Properties

113 114 115
The following public properties can be used to control the plugin
from HTML, the property panel of Visual Basic and most ActiveX aware
applications.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133

+==========+=========+===================================+===============+
| Name:    | Type:   |   Description:                    | Alias:        |
+==========+=========+===================================+===============+
| autoplay | boolean | play when control is activated    | autostart     |
+----------+---------+-----------------------------------+---------------+
| autoloop | boolean | loop the playlist                 | loop          |
+----------+---------+-----------------------------------+---------------+
| mrl      | string  | initial MRL in playlist           | src, filename |
+----------+---------+-----------------------------------+---------------+
| mute     | boolean | mute audio volume                 |               |
+----------+---------+-----------------------------------+---------------+
| visible  | boolean | show/hide control viewport        | showdisplay   |
+----------+---------+-----------------------------------+---------------+
| volume   | integer | set/get audio volume              |               |
+----------+---------+-----------------------------------+---------------+
| toolbar  | boolean | set/get visibility of the toolbar |               |
+----------+---------+-----------------------------------+---------------+
134

135 136 137
The alias column shows an alternative <PARAM name> for the property in
internet explorer, which is useful to maintain compatibility with HTML
pages already leveraging Windows Media Player
138 139 140

2) Programming APIs

141 142 143 144
The MRL, Autoplay and Autoloop properties are only used to configure the
initial state of the ActiveX control,i.e before its activation; they are
ignored afterward. Therefore, if some runtime control is required, the
following APIs should be used within your programming environment:
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170

Variables:

+==========+=========+=========+=======================================+
| Name:    | Type:   | Access: | Description:                          |
+==========+=========+=========+=======================================+
| Playing  | boolean |   RO    | Returns whether some MRL is playing   |
+----------+---------+---------+---------------------------------------+
| Time     | integer |   RW    | Time elapsed in seconds playing       |
|          |         |         | current MRL                           |
|          |         |         | NOTE: live feeds returns 0            |
+----------+---------+---------+---------------------------------------+
| Position | real    |   RW    | Playback position within current MRL  |
|          |         |         | in a scale from 0.0 to 1.0            |
|          |         |         | NOTE: live feeds returns 0.0          |
+----------+---------+---------+---------------------------------------+
| Length   | integer |   RO    | Total length in seconds of current MRL|
|          |         |         | NOTE: live feeds returns 0            |
+----------+---------+---------+---------------------------------------+
| Volume   | integer |   RW    | Current volume from 0 to 100          |
+----------+---------+---------+---------------------------------------+
| Visible  | boolean |   RW    | Indicates whether control is visible  |
+----------+---------+---------+---------------------------------------+

Methods:

171 172 173 174
  *** current interface (0.8.6+) ***
UUID : 9BE31822-FDAD-461B-AD51-BE1D1C159921
defined in axvlc.idl as "coclass VLCPlugin2", "interface IVLCControl2"

175 176
This interface organizes an API with several objects (like .audio.mute).
It is currently documented on videolan wiki (the url may change) at
177 178 179 180 181 182 183
http://wiki.videolan.org/Documentation:Play_HowTo/Advanced_Use_of_VLC


  ***  old interface (deprecated)  ***
UUID : E23FE9C6-778E-49D4-B537-38FCDE4887D8
defined in axvlc.idl as "coclass VLCPlugin", "interface IVLCControl"

184 185 186 187 188
play()
    Play current item the playlist

pause()
    Pause current item in the playlist
189

190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
stop()
    Stop playing current item in playlist

shuttle(Seconds as integer)
    Advance/backtrack playback by specified amount (which is negative for
    backtracking). This is also called relative seeking.
    This method does not work for live streams.

fullscreen()
    Switch between normal and full screen video

playFaster()
    Increase play back speed by 2X, 4X, 8X

playSlower()
    Decrease play back speed by 2X, 4X, 8X

toggleMute()
    mute/unmute sound output

210 211 212 213 214 215 216
addTarget(MRL As String, Options as array of strings,
          Mode as enumeration, Position as integer)
    Add an MRL into the default playlist, you can also specify a list
    of playlist options to attach to this MRL or Null for no options.
    Mode indicates the action taken by the playlist on MRL and is one
    the following:

217 218 219 220 221 222 223
        VLCPlayListInsert       =  1 (Insert MRL into playlist at Position)
        VLCPlayListInsertAndGo  =  9 (Insert MRL into playlist at Position and play it immediately)
        VLCPlayListReplace      =  2 (Replace MRL in playlist at Position)
        VLCPlayListReplaceAndGo = 10 (Replace MRL in playlist at Position and play it immediately)
        VLCPlayListAppend       =  4 (Append MRL in playlist after Position)
        VLCPlayListAppendAndGo  = 12 (Append MRL in playlist after Position and play it immediately)
        VLCPlayListCheckInsert  = 16 (Verify if MRL is in playlist) 
224 225 226

    Position can take the value of -666 as wildcard for the last element
    in the playlist.
227 228 229 230 231


setVariable(Name as string, Value as object);
    Set a value into a VLC variables

232
getVariable(Name as string) as object
233 234 235
    Retrieve the value of a VLC variable.

Regards,
236
    Damien Fouilleul <Damien dot Fouilleul at laposte dot net>
237