Private Sub Media(Width As Int, Height As Int, URL As String) As String
Dim pnl As B4XView = xui.CreatePanel("")
pnl.SetLayoutAnimated(0, 0, 0, Width, Height)
SMM.SetMediaWithExtra(pnl, URL, "", CreateMap(SMM.REQUEST_CALLBACK: Me))
Dim name As String = "view" & BBCodeView1.Views.Size
BBCodeView1.Views.Put(name, pnl)
HandleMediaReadyEvent(pnl)
Return $"[View=${name}/]"$
End Sub
Private Sub HandleMediaReadyEvent(pnl As B4XView)
Wait For (pnl) SMM_MediaReady (Success As Boolean, Media1 As SMMedia)
'do whatever you need with the player view here.
End Sub