B4A Library Streaming an FLV in a web view

Don't know if this will be useful to anyone but this is some brief sample code showing how to get a FLV video streaming inside a web view.

It's still in very basic form, but I wrote it several months ago and haven't found the time to revisit it - so am sharing here 'as is'. While it works it really shouldn't be used in its current version.

The codes not particularly complex - the basic system is that the player is a webview in a new activity that's set to full screen, no title bar and only shows in landscape. The bit that makes it work is using the reflection library to 'setPluginsEnabled' which gives it flash access, then it loads a simple html page that uses this free FLV player to play the video.

Only other important bit is loading a blank page to the web view to stop the sound from playing after you exit.

Its not a perfect system but it works.

(Notes to be aware of - if you hit the fullscreen button in the flash player the app will crash. If you exit out the app without loading the blank webpage the video will stay running, use a lot of cpu and the app will crash. If you load a really large video the app will crash... you get the idea!)

Hardly ground breaking - but I thought someone might find it useful.
:D
 

Attachments

  • FLVPlayer.zip
    7.1 KB · Views: 463

sally3599

Member
Licensed User
Longtime User
Unknown type: reflector when compile

I use v 2.02 and it display the error when compile FLVPlayer.zip
B4X:
Compiling code.                         Error
Error parsing program.
Error description: Unknown type: reflector
Are you missing a library reference?
Occurred on line: 18
Dim r As Reflector
 

hanana

Member
Licensed User
Longtime User
hye..
i wanna ask, is it B4a support flash (flv) file? i wanna build webs app for android..so i need a banner that can view picture in flash...or do u have any solution??

PLeaseeee......Help me!!
 

AntonBrz

Member
Licensed User
Longtime User
Could I show an FLV from a DirAsset?

I'd like to put several short FLV files into the APK. With your code looking for a url this seems impossible. I tried url= (File.DirAsset, "clipname.flv") and (File.DirInternal, clipname.flv) and of course that didn't work. Using internal assets for short clips would eliminate possible connection problems. Can you do this?

Thanks for your response
Anton
 
Top