]> git.sesse.net Git - vlc/blob - projects/activex/README.TXT
update module LIST file.
[vlc] / projects / activex / README.TXT
1 == ACTIVEX Control for VLC ==
2
3 The VLC ActiveX Control has been primary designed to work with Internet Explorer.
4 however it may also work with Visual Basic and/or .NET
5 Please note, that this code does not rely upon Microsoft MFC/ATL code,
6 hence good compatibility is not guaranteed. 
7
8 I. Compiling
9
10 The ActiveX Control should compile without any glitches as long as you have the latest
11 version of mingw gcc and headers. However, In order to script the ActiveX Control
12 on Internet Explorer, a type library is required.
13
14 This type library is usually generated from an IDL file using Microsoft MIDL compiler.
15 Therefore, for convenience I have checked in the output of the MIDL compiler in the
16 repository so that you will only need the MIDL compiler if you change axvlc.idl.
17 the generated files are as follow:
18
19 axvlc_idl.c
20 axvlc_idl.h
21 axvlc.tlb
22
23 To use the MIDL compiler on cygwin, you will need to set some environment variables
24 before configuring vlc. If you have a copy of 'Microsoft Visual C++ 6.0' installed,
25 the following settings are correct:
26
27 export PATH=$PATH:"/cygdrive/c/Program Files/Microsoft Visual Studio/COMMON/MSDev98/Bin":"/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/Bin"
28 export INCLUDE='C:\Program Files\Microsoft Visual Studio\VC98\Include'
29 export MIDL="midl"
30
31 if you are cross-compiling on Linux, you may be able to use 'widl' which is part of
32 the WINE project (http://www.winehq.com), however I have not tested it.
33
34 II. Debugging
35
36 the ActiveX control is compiled with verbose output by default. However you will
37 need to launch Internet Explorer from a Cygwin shell to see the output.
38 Alternatively, the plugin will also use the VLC preferences, hence if you enable
39 the file logging interface through the player and save the preferences, the
40 control will automatically log its verbose output into the designated file.
41
42 Debugging the ActiveX control DLL with GNU GDB can be difficult. Fortunately,
43 the ActiveX control can also be compiled as an executable rather than a DLL.
44 In ActiveX terms, this is called a local server.
45 The advantage of a local server is that it will never crash its client,
46 i.e Internet Explorer, if itself is crashing.
47 The build system does not currently allow to create an executable version of
48 the ActiveX control, you will need to manually define the BUILD_LOCALSERVER
49 pre-processor variable and modify the Makefile to exclude the '-shared' option
50 at the linking stage. Once this is done, you just need to launch axvlc.exe to
51 have a working Activex control. Please note, that executable version of the
52 ActiveX control will override any settings required for the DLL version, which
53 will no longer work until you (re)register it as shown in the following section
54
55 III. Local Install
56
57 The VLC NSIS installer will install the ActiveX Control without requiring any
58 further manual intervention, but for people who like to live on the edge, here
59 are the steps you need to perform once you have built the ActiveX Control.
60
61 The ActiveX control DLL file may be copied anywhere on the target machine,
62 but before you can use the control, you will need to register it with Windows
63 by using the REGSVR32 command, as per following example:
64
65 REGSVR32 C:\WINDOWS\AXVLC.DLL
66
67 if the control needs to use external VLC plugins (i.e other than built-in ones),
68 make sure that the plugin path is set in the registry as per following example:
69
70 [HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC]
71 InstallDir="C:\Program Files\VideoLAN\VLC"
72
73 The InstallDir must be the parent directory of the 'plugins' directory.
74
75 WARNING: Both control and plugins must come from the same build source tree.
76 Otherwise, at best, the control will not play any content, at worse
77 it may crash Internet Explorer while attempting to load incompatible plugins.
78
79 IV. Internet Install
80
81 The activex control may be installed from a remote through Internet Installer if
82 it is packaged up in a CAB file. The following link explains how to achieve this
83
84 http://msdn.microsoft.com/workshop/components/activex/packaging.asp
85
86 For convenience, I have provided a sample axvlc.INF file, which assumes that the VLC
87 NSIS Installer has been packaged up a CAB file called AXVLC.CAB.
88
89 The ActiveX Control DLL file can also be distributed by itself if it has been
90 compiled with built-in VLC plugins; check developer information for more
91 information on built-in plugins.
92
93 V. Controlling the plugin
94
95 1) Properties
96
97 the following public properties can be used to control the plugin from HTML,
98 the property panel of Visual Basic and most ActiveX aware applications 
99
100 +==========+=========+================================+===============+
101 | Name:    | Type:   |   Description:                 | Alias:        |
102 +==========+=========+================================+===============+
103 | autoplay | boolean | play when control is activated | autostart     |
104 +----------+---------+--------------------------------+---------------+
105 | autoloop | boolean | loop the playlist              | loop          |
106 +----------+---------+--------------------------------+---------------+
107 | mrl      | string  | initial MRL in playlist        | src, filename |
108 +----------+---------+--------------------------------+---------------+
109 | mute     | boolean | mute audio volume              |               |
110 +----------+---------+--------------------------------+---------------+
111 | visible  | boolean | show/hide control viewport     | showdisplay   |
112 +----------+---------+--------------------------------+---------------+
113 | volume   | integer | set/get audio volume           |               |
114 +----------+---------+--------------------------------+---------------+
115
116 the alias column allows to specify an alternative <PARAM name> for the
117 property in internet explorer, which is useful to maintain compatibility
118 with HTML pages already leveraging Windows Media Player
119
120 2) Programming APIs
121
122 the MRL, Autoplay and Autoloop properties are only used to configure the initial
123 state of the ActiveX control,i.e before its activation; they are ignored afterward.
124 Therefore, if some runtime control is required, the following APIs should be used
125 within your programming environment:
126
127 Variables:
128
129 +==========+=========+=========+=======================================+
130 | Name:    | Type:   | Access: | Description:                          |
131 +==========+=========+=========+=======================================+
132 | Playing  | boolean |   RO    | Returns whether some MRL is playing   |
133 +----------+---------+---------+---------------------------------------+
134 | Time     | integer |   RW    | Time elapsed in seconds playing       |
135 |          |         |         | current MRL                           |
136 |          |         |         | NOTE: live feeds returns 0            |
137 +----------+---------+---------+---------------------------------------+
138 | Position | real    |   RW    | Playback position within current MRL  |
139 |          |         |         | in a scale from 0.0 to 1.0            |
140 |          |         |         | NOTE: live feeds returns 0.0          |
141 +----------+---------+---------+---------------------------------------+
142 | Length   | integer |   RO    | Total length in seconds of current MRL|
143 |          |         |         | NOTE: live feeds returns 0            |
144 +----------+---------+---------+---------------------------------------+
145 | Volume   | integer |   RW    | Current volume from 0 to 100          |
146 +----------+---------+---------+---------------------------------------+
147 | Visible  | boolean |   RW    | Indicates whether control is visible  |
148 +----------+---------+---------+---------------------------------------+
149
150 Methods:
151
152 play()
153     Play current item the playlist
154
155 pause()
156     Pause current item in the playlist
157     
158 stop()
159     Stop playing current item in playlist
160
161 shuttle(Seconds as integer)
162     Advance/backtrack playback by specified amount (which is negative for
163     backtracking). This is also called relative seeking.
164     This method does not work for live streams.
165
166 fullscreen()
167     Switch between normal and full screen video
168
169 playFaster()
170     Increase play back speed by 2X, 4X, 8X
171
172 playSlower()
173     Decrease play back speed by 2X, 4X, 8X
174
175 toggleMute()
176     mute/unmute sound output
177
178 addTarget(MRL As String, Options as array of strings, Mode as enumeration, Position as integer)
179     Add MRL into the default playlist, you can also specify a list of playlist Options to attach
180     to this MRL or Null for no options. mode indicates the action taken by the playlist on MRL
181     which is one the following:
182         VLCPlayListInsert       =  1 (Insert MRL into playlist at Position)
183         VLCPlayListInsertAndGo  =  9 (Insert MRL into playlist at Position and play it immediately)
184         VLCPlayListReplace      =  2 (Replace MRL in playlist at Position)
185         VLCPlayListReplaceAndGo = 10 (Replace MRL in playlist at Position and play it immediately)
186         VLCPlayListAppend       =  4 (Append MRL in playlist after Position)
187         VLCPlayListAppendAndGo  = 12 (Append MRL in playlist after Position and play it immediately)
188         VLCPlayListCheckInsert  = 16 (Verify if MRL is in playlist) 
189     Position can take the value of -666 as wildcard for the last element in playlist
190
191
192 setVariable(Name as string, Value as object);
193     Set a value into a VLC variables
194
195 getVariable( Name as string) as object
196     Retrieve the value of a VLC variable.
197
198 Regards,
199     Damien Fouilleul <Damien dot Fouilleul at laposte dot net>
200