I IdasI4A Active Member Licensed User Longtime User May 17, 2025 #1 I used ExoPlayer to make a playlist for a number of video files as follows: B4X: Copy Dim sources As List sources.Initialize for i=1 to 10 sources.Add(player1.CreateFileSource(File.DirAssets, i & ".mp4")) next player1.Prepare(player1.CreateListSource(sources)) how can i make it start with the file 4.mp4? i.e. when i do player1.play it will play the file 4.mp4. Thanks
I used ExoPlayer to make a playlist for a number of video files as follows: B4X: Copy Dim sources As List sources.Initialize for i=1 to 10 sources.Add(player1.CreateFileSource(File.DirAssets, i & ".mp4")) next player1.Prepare(player1.CreateListSource(sources)) how can i make it start with the file 4.mp4? i.e. when i do player1.play it will play the file 4.mp4. Thanks
Solution teddybear May 17, 2025 IdasI4A said: Thank you. But what I want is that when I press next track (in the ExoPlayer control) I see the next video and when I press previous video I see the previous video. View attachment 164127 Click to expand... Try this code B4X: Copy player1.As(JavaObject).GetField("player").As(JavaObject).RunMethod("seekToDefaultPosition", Array(4))
IdasI4A said: Thank you. But what I want is that when I press next track (in the ExoPlayer control) I see the next video and when I press previous video I see the previous video. View attachment 164127 Click to expand... Try this code B4X: Copy player1.As(JavaObject).GetField("player").As(JavaObject).RunMethod("seekToDefaultPosition", Array(4))
zed Well-Known Member Licensed User May 17, 2025 #2 Maybe this. Code: Copy Dim sources As List sources.Initialize for i=1 to 10 source.add( i & ".mp4") next player1.Prepare(player1.CreateFileSource(File.DirAssets, source.get(4)) Upvote 0
Maybe this. Code: Copy Dim sources As List sources.Initialize for i=1 to 10 source.add( i & ".mp4") next player1.Prepare(player1.CreateFileSource(File.DirAssets, source.get(4))
I IdasI4A Active Member Licensed User Longtime User May 17, 2025 #3 Thank you. But what I want is that when I press next track (in the ExoPlayer control) I see the next video and when I press previous video I see the previous video. Upvote 0
Thank you. But what I want is that when I press next track (in the ExoPlayer control) I see the next video and when I press previous video I see the previous video.
teddybear Well-Known Member Licensed User May 17, 2025 #4 IdasI4A said: Thank you. But what I want is that when I press next track (in the ExoPlayer control) I see the next video and when I press previous video I see the previous video. View attachment 164127 Click to expand... Try this code B4X: Copy player1.As(JavaObject).GetField("player").As(JavaObject).RunMethod("seekToDefaultPosition", Array(4)) Upvote 1 Solution
IdasI4A said: Thank you. But what I want is that when I press next track (in the ExoPlayer control) I see the next video and when I press previous video I see the previous video. View attachment 164127 Click to expand... Try this code B4X: Copy player1.As(JavaObject).GetField("player").As(JavaObject).RunMethod("seekToDefaultPosition", Array(4))