Android Question ExoPlayer infinite loop of sourceList

Herbert32

Active Member
Licensed User
Longtime User
Hi all,

is there a way to play my source-list in a infinite loop?

video1
video2
video3
video1
video2
video3
video1
video2
...

within CreateLoopSource I'm not able to set my sources-list as source :-(

Best regards
Herbert
 

Herbert32

Active Member
Licensed User
Longtime User
i receive this error-message:

java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.google.android.exoplayer2.source.MediaSource
 
Upvote 0

Herbert32

Active Member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
   
    ffiles.Initialize
    ffolders.Initialize
    root="/mnt/extsd"
'    Log(root)
    search(root,True)
    Log(ffolders.Size&" folder / "&ffiles.Size&" files")

    If FirstTime Then
        player1.Initialize("player")
        Dim sources As List
        sources.Initialize
        sources.Add(player1.CreateFilesource(root,ffiles.Get(0)))
        sources.Add(player1.CreateFilesource(root,ffiles.Get(1)))
        sources.Add(player1.CreateFilesource(root,ffiles.Get(2)))
        sources.Add(player1.CreateFilesource(root,ffiles.Get(3)))
        player1.Prepare(player1.CreateListSource(sources))
        player1.Prepare(player1.CreateLoopSource(sources,-1))
    End If

    Activity.LoadLayout("1")

    SimpleExoPlayerView1.Player = player1
    player1.Play
End Sub
 
Upvote 0

Herbert32

Active Member
Licensed User
Longtime User
B4X:
        player1.Prepare(player1.CreateLoopSource(player1.CreateListSource(sources),-1))

shows no error - i actually check if its really looping
 
Upvote 0
Top