It looks like you need to change to PIP mode before the application is going into the background.
Example:
Sub StartPlayingVideo(playerViewController2 As NativeObject)
Dim player As NativeObject = playerViewController2.GetField("player")
player.RunMethod("play", Null)
StartPIP
End Sub
I tried to call it from B4XPage_Disappear and it didn't work.
Might work from Application_Inactive.
And worth adding a call to StartBackgroundTask (put the inline OBJC before the current ones).