Sub PlayerIntros
' Show videos or images of players in that preferential order
For Each k As Object In mapHomeTeam.Keys
Dim playerId As String = mapHomeTeam.Get(k)
For a = 0 To mapHomeTeam.Size - 1
If playerId = arrayHome(a, 0) Then
Dim mediaFile As String = arrayHome(a, 1).SubString(arrayHome(a, 1).IndexOf(" ") + 2)
If IntroVideos(mediaFile & ".mp4", arrayHome(a, 1).SubString2(0, 2).Trim) = True Then
Timer5.Enabled = True
wait For mppp_Complete
Timer5.Enabled = False
mMediaViewNode.RemoveNodeFromParent
Else if IntroImages(mediaFile & ".png", arrayHome(a, 1).SubString2(0, 2).Trim) = True Then
Sleep(txtIntrosDelay.text * 1000)
Else
IntroImages("noImageFile.png", arrayHome(a, 1).SubString2(0, 2).Trim)
Sleep(txtIntrosDelay.text * 1000)
End If
End If
Next
Next
End Sub
Sub Timer5_tick
Log("Error" & Display.playerNumber.text)
mppp_Complete
End Sub
Sub mppp_Complete
Log("mppp_Complete")
End Sub
Sub IntroVideos(videoFile As String, pNum As String ) As Boolean 'firstname dot space secondname, player singlet number
Display.playerNumber.text = pNum
Display.playerNumber.top = Display.ivGraphics.Top
Display.playerNumber.left = Display.ivGraphics.Left + (Display.ivGraphics.Width / 50)
Display.playerNumber.TextSize = playerNumberFontSize * Display.ivGraphics.Width / 1920
Display.playerNumber.visible = True
If File.Exists(PublicApplicationDataFolder & "\Intros\" & cmbOrganisationID.Value, videoFile) = True Then
mppp.Initialize("mppp",File.GetUri(PublicApplicationDataFolder & "\Intros\" & cmbOrganisationID.Value, videoFile))
mv.InitializeNewInstance("javafx.scene.media.MediaView",Array(mppp))
mMediaViewNode = mv
Display.fullPane.AddNode(mMediaViewNode,0,0,-1,-1)
mv.RunMethod("setFitWidth",Array(videoWidth))
mv.RunMethod("setFitHeight",Array(videoWidth*9/16))
mMediaViewNode.Visible = True
mppp.play
Display.playernumber.As(B4XView).BringToFront
Return True
Else
Display.playernumber.As(B4XView).BringToFront
Return False
End If
End Sub