Android Question MediaPlayerStream for playing an flv (video) from an URL

Ratna Fang

Member
Licensed User
Longtime User
is it possible to load and play a flv (video) from a specific URL?

i have simple code which i follow from the sample audio library

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim Video1 As MediaPlayerStream
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Video1.Initialize("Video1")
   
   
    'load streaming
    Video1.Load("http://www.sample.com/videos/flv/1/c/4/sample.com_1c455f3ca57a7292f214731a5e957947.flv?e=1389555728&ri=1024&rs=85&h=9149ffa7e5277a0ab82bba1750a59ce5")
   
   
End Sub


Sub Video1_StreamReady
    Log("starts playing")
    Video1.Play
End Sub

Sub Video1_StreamError (ErrorCode As String, ExtraData As Int)
    Log("Error: " & ErrorCode & ", " & ExtraData)
    ToastMessageShow("Error: " & ErrorCode & ", " & ExtraData, True)
End Sub

Sub Video1_StreamBuffer(Percentage As Int)
    Log(Percentage)
End Sub

if i type such the URL in a browser, i'll get a download file (a FLV file). if i type the URL in the code, i'll get a respond "error format" or something like that.

anything wrong with my code? or i should check some documentation about this audio library?

thanks
 

Mark Read

Well-Known Member
Licensed User
Longtime User
You could try the Vitamio library (Link), which is easy to use and can stream flv files. Another possibility would be installing VLC and running with an intent.
Regards
 
Upvote 0
Top