Android Question Load two videoview at same time

Juanll2003uy

Member
Licensed User
Longtime User
Im using a HIKVISION DVR and a samsung J5 Android 5.
The problem i have is to see two cams at same time.
Someone can tell me how load two videoviews at same time?
Im using two panels with a videoview each one, first loads ok, but when i try load second vv the first "stop" and in second vv i see both cams at same time.
Thanks

This code is which i use to load one and other:

If view=1 Then
vv.Initialize("vv")
myPanel.AddView(vv, 0dip, 0dip, 100%x,100%y)
vv.LoadVideo("http","rtsp://user:[email protected]-remote.com:554/h264/ch" & Chn & "/main/av_stream")
vv.MediaControllerEnabled=True
Else if view=2 Then
vv2.Initialize("vv2")
myPanel2.AddView(vv2, 0dip, 0dip, 100%x,100%y)
vv2.LoadVideo("http","rtsp://user:[email protected]-remote.com:554/h264/ch" & Chn & "/main/av_stream")
vv2.MediaControllerEnabled=True
End If
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It will work if your device supports it.

For example on a Nexus 5X:

upload_2016-6-17_7-50-53.png


B4X:
Sub Activity_Create(FirstTime As Boolean)
   vv1.Initialize("")
   vv2.Initialize("")
   
   File.Copy(File.DirAssets, "Asteroids.mp4", File.DirRootExternal, "1.mp4")
   Activity.AddView(vv1, 0, 0, 100%x, 50%y)
   Activity.AddView(vv2, 0, 50%y, 100%x, 50%y)
   vv1.LoadVideo(File.DirRootExternal, "1.mp4")
   vv2.LoadVideo(File.DirRootExternal, "1.mp4")
End Sub
 
Upvote 0
Top