I am trying to create a picture-in-picture type setup with 2 ExoPlayers at once.
I am having a hard time doing this. The first player I initialize takes over the other Exo views. Then if I resize the first player, I can see both movies playing at once together in the same view, even though I am diming 2 different players and assigning them to 2 different windows. Its all messed up. Any ideas?
any thoughts?
I am having a hard time doing this. The first player I initialize takes over the other Exo views. Then if I resize the first player, I can see both movies playing at once together in the same view, even though I am diming 2 different players and assigning them to 2 different windows. Its all messed up. Any ideas?
B4X:
Sub Globals
Private ForegroundPlayerView As SimpleExoPlayerView
Private BackgroundPlayerView As SimpleExoPlayerView
Timer1.Initialize("Timer1",5000)
Timer1.Enabled = False
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
BackgroundPlayer.Initialize("player")
ForegroundPlayer.Initialize("player2")
BackgroundPlayer.Prepare(BackgroundPlayer.CreateLoopSource(BackgroundPlayer.CreateFileSource(File.DirAssets, "blue1.mp4"),-1))
ForegroundPlayer.Prepare(ForegroundPlayer.CreateLoopSource(ForegroundPlayer.CreateFileSource(File.DirAssets, "sport.mp4"),-1))
End If
Activity.LoadLayout("1")
Sleep(1000)
ForegroundPlayerView.Player = ForegroundPlayer
BackgroundPlayerView.Player = BackgroundPlayer
BackgroundPlayer.Play
' ForegroundPlayer.Play
Dim p As PhoneWakeState
Log("releasing KeepAlive")
p.ReleaseKeepAlive
Log("turning screen on")
p.KeepAlive(True)
Log("using partialLock")
p.PartialLock
Timer1.Enabled = True
End Sub
any thoughts?