Streaming Video

aaronk

Well-Known Member
Licensed User
Longtime User
Hello,

Has anyone had any luck in streaming H.264 video in B4A ?

I have a video stream (not a YouTube video) that I want to be able to stream in my app but need a way in doing it..

Anyone able to help with this, or is it on the to do list ?
 

aaronk

Well-Known Member
Licensed User
Longtime User
Hello,

I ended up getting it working using the code below..

On my Nexus7 it takes like 2-3 seconds to show the image, but on my Galaxy SII 4G it takes about 60 - 70 seconds to load / start streaming, and the video stream image size is only 352 x 288 (if that makes any difference) - Both connected using Wi-Fi and connecting to the stream on the local network.

When I tap the image it shows the seek bar down the bottom of the image, is there a way to hide this so it don't come up at all when someone taps on it ?

B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
Dim vvv As VideoView 
Dim pp As Phone
End Sub

Sub Activity_Create(FirstTime As Boolean)

vvv.Initialize("vvv")
Activity.AddView(vvv,0,0,Activity.Width,Activity.Height)
vvv.LoadVideo("http","rtsp://xxx.xxx.xxx.xxx:yyyy/h264")
vvv.Play

End Sub
Sub vv1_Complete
   Log("complete")
End Sub
Sub Activity_Resume
pp.SetScreenOrientation(0)
End Sub

Sub Activity_Pause (UserClosed As Boolean)
pp.SetScreenOrientation(1)
End Sub
 
Upvote 0
Top