home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / vlc-2-0-5-win32.exe / sdk / activex / README.TXT next >
Text File  |  2012-12-12  |  10KB  |  238 lines

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