Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to play swf files and flv files on a Shockwave Flash Object.Below is my code that works fine with swf file.

VB
Dim path As String  = Application.StartupPath & "\Videos\01_ch4sec3.swf"
AxShockwaveFlash1.LoadMovie(0, path)
AxShockwaveFlash1.Stop()
AxShockwaveFlash1.Play()
AxShockwaveFlash1.Loop = True


And this code for flv files doesn't work.

VB
Dim path As String  = Application.StartupPath & "\Videos\01_ch4sec4.flv"
AxShockwaveFlash1.LoadMovie(0, path)
AxShockwaveFlash1.Stop()
AxShockwaveFlash1.Play()
AxShockwaveFlash1.Loop = True


What could be the problem.Thanks in advance.
Posted
Comments
Prasad Khandekar 30-May-13 9:59am    
How about using NET VLC Library (http://vlcdotnet.codeplex.com/)?

The problem your are having playing a FLV file is due to a restriction that ADOBE placed on FLV files with the Shockwave control. They need to be played through a player file. The player file is what you would assign as the AxShockwaveflash1.Movie property. The FLV file is set via the FlashVars property.

The problem is how do you get this player file. You can search the internet and hopefully find one. I have found a free utility from AnvSoft called AnvSoft Web FLV Player (http://web-flv-player.com/flv-player-free.html) that will generate the file for you when you use it's "Publish" feature.

Using the AnvSoft generated "player.swf" file, the code would be something like this:

VB
AxShockwaveFlash1.Movie = My.Application.Info.DirectoryPath & "\player.swf"
AxShockwaveFlash1.FlashVars = "flvURL=" & My.Application.Info.DirectoryPath & "\20051210-w50s.flv&ControlPanelColor=0xccff00&buttonColor=0x000000&ControlPanelPosition=0&showControlPanel=1&ShowtimeColor=0xffffff&bAutoPlay=1&bAutoRepeat=0&BufferTime=5&tmeColor=0xffffff&loaColor=0x666666&GroundColor=0x000000&conNum=5&bShowtime=1&startvolume=100"
AxShockwaveFlash1.Play()

You can play with the utility program to learn how to set the various "FlashVars" by looking at the html file that is also generated.

I have found that the showControlPanel uses these:
0 = No control panel
1 = Control panel always visible
2 = Control panel shows on hover-over

Hopefully this helps.
 
Share this answer
 
v3
The C#.NET article - Fun with C# and the Flash Player 8 External API[^] will help you find the logic. So, you can easily implement that in VB.NET.

You can also check the discussion - Playing FLV Files from VB.NET[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900