I need to show two different videos in my apk. So i added VideoView1 and VideoView2 components to show videos in my apk. I added 2 different urls for both VideoView components and only first video is played second video displays message this video cannot be played.
Is there solution to make work two VideoView compomponents with two different URLs?
Here is code that i try:
Is there solution to make work two VideoView compomponents with two different URLs?
Here is code that i try:
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 VideoView1, VideoView2 As VideoView
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")
'INIT - VideoView
VideoView1.Initialize("VideoView1")
'Initialize VideoViewRelativeLayout
Dim VideoViewRelativeLayout1 As VideoViewRelativeLayout
VideoViewRelativeLayout1.Initialize
'Add VideoView To VideoViewRelativeLayout
VideoViewRelativeLayout1.SetVideoView(VideoView1)
VideoView1.LoadVideo("http", "http://myURLA.com")
VideoView1.Play
'INIT - VideoView
VideoView2.Initialize("VideoView2")
'Initialize VideoViewRelativeLayout
Dim VideoViewRelativeLayout2 As VideoViewRelativeLayout
VideoViewRelativeLayout2.Initialize
'Add VideoView To VideoViewRelativeLayout
VideoViewRelativeLayout2.SetVideoView(VideoView2)
VideoView2.LoadVideo("http", "http://myURLB.com")
VideoView2.Play
'ADDVIEW - VideoView
Activity.AddView(VideoViewRelativeLayout1, 0, 0, 100%x, 100%y)
Activity.AddView(VideoViewRelativeLayout2, 0, 50%y, 100%x, 100%y)
End Sub