Application 2 of VLC: ActiveX and cab of VLC

Source: Internet
Author: User
Supplement: 8. Uninstall ActiveX; 9. Enable VLC to automatically install ActiveX; 10. Instructions on VLC ActiveX.
VLC comes with the ActiveX control-axvlc. dll, which is in the ActiveX folder after the VLC is compiled. ActiveX is a good thing, Axvlc. dll Yes Place it anywhere, After successful registration, you can easilyProgramAnd web pages. For more information, see test.html and readme. txt under the activexfile folder. ActiveX Control interfaces are available in the first and second versions. The first version is simple and has fewer functions. We recommend that you use the second version instead of maintenance. (Refer to [1]) ActiveX registration methods for vlc-0.8.6i and vlc-0.9.4 are slightly different.Before ActiveX web page testing, you must set the security level of the Internet option> Security> Local Intranet to a minimum. Jeremiah's webpage test environment is IE7, which is not tested by other browsers.1. vlc-0.8.6iOfActiveX Registration Create a folder vlc-0.8.6iActiveX under E:, copy the Plugins, libvlc. dll, ActiveX/axvlc. dll under the vlc-0.8.6i directory Copy ActiveX/test.html Under the vlc-0.8.6iActiveX. The content of Install. bat in the new text file is as follows: Regsvr32 DLLs \ axvlc. dll
After you double-click Install. bat, the message "dllregisterserver in DLLs \ axvlc. dll" is displayed ". After that, open test.html and input MRL in the text box to play the video. 2. ActiveX registration of vlc-0.9.40.9.4 not only tells the computer the location of the axvlc. dll of the VLC, but also tells the Registry the location of installdir, that is, the location of libvlc. dll. Create a folder vlc-0.9.4ActiveX under E:, copy the Plugins, libvlc. dll, libvlccore. dll, ActiveX/axvlc. dll under the vlc-0.9.4 directory Copy ActiveX/test.html Under the vlc-0.9.4ActiveX. The content of the new text file install. Reg is as follows: Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE \ SOFTWARE \ VideoLAN \ VLC]"Installdir" = "e :\\ vlc-0.9.4ActiveX \ DLLs"
The content of Install. bat in the new text file is as follows:
Regsvr32 DLLs \ axvlc. dllRegedit/s install. Reg
After double-hitting install.bat, you can use test.html for testing.3. a few tipsIf the registration is successful, but when the test.html file is played, the system reports an error saying that decoder modules cannot find such information. Please register 0.8.6i and 0.9.4 in turn, which may solve this problem. (Jeremiah had a day with this problem. nnd .)4. Create a cab fileIf you want to use player and test.html as a player server, you cannot manually manipulate it. The client downloads ActiveX for registering VLC. The solution is to create a cab file by yourself.(1) Attachment of this log (Cabsdk.rar) or The following addresses Download cabsdk.exe: Http://download.microsoft.com/download/platformsdk/cab/2.0/w98nt42kmexp/en-us/cabsdk.exe(2) install cabsdk.exe(3) copy the axvlc. dll and vlc installation files to the cabsdk installation path/bin. Jeremiahuses vlc-0.8.6i-win32.exe. (For how to create the Installation File of VLC, refer to the log "Windows platform VLC compilation II: vlc-0.8.6i compilation") (4) create a text file axvlc. inf in/bin. The content is as follows: ; Version number and signature of INF file.;[Version]Signature = "$ Chicago $"Advancedinf = 2.0[Add. Code]Vlc-0.8.6i-win32.exeAxvlc. dll = axvlc. dll[Axvlc. dll]Fileversion = 0, 8, 6, 0CLSID = {9be31822-fdad-461b-ad51-be1d1c159921}Registerserver = NoHook = nsiinstaller[Vlc-0.8.6d-win32.exe]Fileversion = 0, 8, 6, 0File-win32-x86 = thiscab[Nsiinstaller]Run = % extract_dir %\ vlc-0.8.6i-win32.exe
Note: modify this file based on the version of the Installation File. (5) run the command line to the bin directory and run the following command to generate the cab file: Cabarc. EXE n axvlc. Cab axvlc. inf axvlc. dll vlc-0.8.6i-win32.exe
5. Use of the cab file You can use the following methods to use the cab file on the HTML page: <Object classid = "CLSID: 9be31822-fdad-461b-ad51-be1d1c159921" Codebase = "Your/path/of/cabfile/axvlc. Cab" Width = "640" Height = "480" id = "VLC" events = "true"> < Param Name = "Src" Value = "" /> < Param Name = "Showdisplay" Value = "True" /> < Param Name = "Autoloop" Value = "False" /> <Param Name= "Autoplay" Value= "False" /></Object>
In this way, the Web Client can be used without manually registering axvlc. dll. 6. A small and serious problemBecause the Installation File of VLC is usually large, the created cab file is also large. When the network bandwidth is not good, it may take a long time to download the cab, basically, this method won't work. So
We VLC needs to be streamlined based on your business needs. Jeremiah will introduce it in the next log. 7. C # Use VLC ActiveX Create a Windows Application in vs2005. Right-click the Toolbox on the left and choose items> COM component> VideoLAN VLC ActiveX plugin V2. The ActiveX Control of VLC is added to the toolbox, you can draw any image in the form. The call function is as follows: Private Void Button#click ( Object Sender, eventargs E) { // Input parameters String Parameter = ": Sout = # duplicate {DST = display}: No-overlay" ; // Determine whether the video is being played If ( This . Axvlcplugin21.playlist. isplaying) { // If playing is in progress, stop This . Axvlcplugin21.playlist. Stop (); } // Clear the playlist This . Axvlcplugin21.playlist. Clear ();// Add a playlistThis. Axvlcplugin21.playlist. Add (textbox1.text,Null, Parameter );// Update the playlist to the added playlistThis. Axvlcplugin21.playlist. Next (); // PlayThis. Axvlcplugin21.playlist. Play ();}
For more information about other functions, see ActiveX/readme. txt.Jeremiahprovided a simple calling program (windowsapplication1.rar), but note that,Use it to test ActiveX of 0.9.4. When a normal file is played, click X to close the window.An exception occurs and the computer restarts.. In Formclosing The main thread is sleeping for 1000 ms in the event, and the computer does not have to be restarted. Therefore, debug the attachment as needed.   8. Uninstall ActiveX Uninstallation is a reverse operation of installation. Knowing how to install it is easy to uninstall. Uninstall ActiveX of the vlc-0.8.6i: Create Uninstall. bat with the following content: Regsvr32 DLLs \ axvlc. dll/u
Uninstall ActiveX of the vlc-0.9.4: Create Uninstall. Reg with the following content: Windows Registry Editor Version 5.00[-HKEY_LOCAL_MACHINE \ SOFTWARE \ VideoLAN]
Create Uninstall. bat with the following content: Regsvr32 DLLs \ axvlc. dll/uRegedit/s Uninstall. Reg
Double-click Uninstall. BAT to prompt that the dllunregisterserver in DLLs \ axvlc. dll is successful. The uninstallation is complete.   9. Enable ActiveX to be automatically installed during VLC Installation 4. Make the cab package and 5. Use the cab package. In fact, the cab allows the customer to automatically download the installation file of the VLC and then start the installation. However, the following steps are displayed during installation:
By default, ActiveX plugin is not selected. How can we make it selected by default or gray (such as media player) to prevent customers from changing it? We need to modify the compiled VLC. win32.nsi file. Then, we will re-create vlc-0.9.4-win32.exe with ghost. The specific modification process is as follows: In the VLC. win32.nsi file, find:Section/o $ name_section04 sec04Sectionin 3
To: Section $ name_section04 sec04Sectionin 1 2 3
Or Add "Space ro" after "1 2 3", indicating that this item is required and cannot be removed, that is, it is selected and gray. You can replace $ name_section04 with your own name, such as "My ActiveX plugin (required.
Afterwards, the previous blog will explain how to make vlc-0.9.4-win32.exe and then create the cab package.   10. Description of VLC ActiveX According to my use of VLC ActiveX, I found that this ActiveX is really not good, and many methods are not encapsulated. If you expand this ActiveX, the workload is not small. For c/s programs,ActiveX is strongly not recommended for development.. Unless you want to do something simple, fast development, etc. For the C/S player, read my blog :《Application 3 of VLC: dynamic call of libvlc. dll of vlc-0.9.4", Although the development process is slow, it is relatively controllable.ActiveX is applicable only to B/S projects and only for web development.This is Jeremiah's advice, but it only belongs to my opinion and is for reference only. Reference URL:1. http://rogerfd.cn /? P = 1572. http://wiki.videolan.org/ActiveX/HTML3. http://wiki.videolan.org/ActiveX4. http://forum.videolan.org/viewtopic.php? F = 14 & t = 48812 & P = 155832 & hilit = regsvr # p1560705. http://www.onlyblog.com/blog2/zyjzyj2000/10184.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.