Hi
I'm playing a video. When I close the full screen ad, it closes abruptly when I watch it again. what would be the reason.
only when the full screen ad is closed.
it suddenly turns off when I close the video and re-enter it.
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
			
			I'm playing a video. When I close the full screen ad, it closes abruptly when I watch it again. what would be the reason.
only when the full screen ad is closed.
it suddenly turns off when I close the video and re-enter it.
			
				B4X:
			
		
		
		Sub Globals
Private SimpleExoPlayerView1 As SimpleExoPlayerView
Private BannerAd As AdView
Private tm As InterstitialAd
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
player1.Initialize("player")
player1.Prepare(player1.CreateHLSSource("http://xxxxxx.175.xxxxxxxxxxxxxxxxxxxx"))
End If
Activity.LoadLayout("1")
SimpleExoPlayerView1.Player = player1 'Connect the interface to the engin
BannerAd.Initialize2("BannerAd", "ca-app-pub-xxxxxx8358736xx/x85863xxxx", BannerAd.SIZE_SMART_BANNER)
Dim height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
' 'phones
If 100%x > 100%y Then height = 32dip Else height = 50dip
Else
'tablets
height = 90dip
End If
Activity.AddView(BannerAd, 0dip, 100%y - height, 100%x, height)
BannerAd.LoadAd
tm.Initialize("tm", "ca-app-pub-xxxxx38358736xxx/x989xxxxx")
tm.LoadAd
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
player1.Pause
If tm.Ready Then tm.Show
Else
Activity.Finish
StartActivity(Main)
Return True
End If
Return False
End Sub
Sub tm_AdClosed
Activity.Finish
StartActivity(Main)
End SubAttachments
			
				Last edited: 
			
		
	
								
								
									
	
								
							
							 
				 
 
		 
			 
 
		 
 
		 
			 
			 
			 
			 
			 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		