Android Question About Exoplayer

Sganga61

Member
Licensed User
Longtime User
Hi Friends
I'm try to pass the link to the exoplayer player using:

B4X:
dim LINK as string
LINK = "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8"

    sources.Initialize
    sources.Add (XPanel.CreateUriSource(LINK))                   'this code seems wrong
    XPanel.Prepare(XPanel.CreateListSource(sources))
    SimpleExoPlayerView1.Player = XPanel
    XPanel.Play
    Activity.Invalidate

but don't play anything (and no error messages appear)

if I change only the code (using exactly the same link):

B4X:
     sources.Add (XPanel.CreateUriSource("https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8"))

All working fine

So I think that it is impossible to pass a link using a variable.

Any idea?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is no difference between using a variable or a string.

You should use CreateHLSSource with this link:
B4X:
Dim sources As List
sources.Initialize
Dim LINK As String = "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8"
sources.Add (player1.CreateHLSSource(LINK))
player1.Prepare(player1.CreateListSource(sources))
 
Upvote 0
Top