I want to be able to take the same player/video file and mirror it on two views. Here is my code:
However, its only appearing in one view and not both.
How can i fix this? thanks.
B4X:
'Play a video on-screen
Sub PlayVideo(Args() As Object)
Dim Side As Int = Args(0)
Dim Video As Int = Args(1)
Dim Looping As Boolean = Args(2)
player1.Initialize("player")
Select Case Video
Case 0 'Play american flag animation
If Looping = True Then
player1.Prepare(player1.CreateLoopSource(player1.CreateFileSource(File.DirAssets, "flag.mp4"), -1))
Else
player1.Prepare(player1.CreateFileSource(File.DirAssets, "flag.mp4"))
End If
Case 1 'Play boot logo animation
End Select
If Side = 1 Then 'Guest
PlayerViewGuest.Player = player1
PlayerViewGuest.ResizeMode = "FILL"
PlayerViewGuest.Visible = True
Else if Side = 2 Then 'Home
PlayerViewHome.Player = player1
PlayerViewHome.ResizeMode = "FILL"
PlayerViewHome.Visible = True
Else 'Both
PlayerViewGuest.Player = player1
PlayerViewHome.Player = player1
PlayerViewHome.ResizeMode = "FILL"
PlayerViewGuest.ResizeMode = "FILL"
PlayerViewGuest.Visible = True
PlayerViewHome.Visible = True
End If
player1.Play
End Sub
However, its only appearing in one view and not both.
How can i fix this? thanks.