Android Question Play a video loop in a panel/canvas/etc?

techknight

Well-Known Member
Licensed User
Longtime User
I am looking to play a video which is actually an animation. I want to play it in a continuous loop with no stop/play controls/bars, and then set other labels/panels on top of it with different opacities. Think of a news style environment where they have layers of information on top of a looping animation.

Is this possible? If so, any pointers?
 

moster67

Expert
Licensed User
Longtime User
Can't you just use VideoView (see standard audio-lib) and in the Complete event restart the video?
Also I don't see any problems adding label and panels on the top of VideoView..should be possible
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
With the exoplayer example, I keep getting this:

Generating R file. Error
invalid resource directory name: E:\Xojo Crap\B4A Samples\Objects\bin\extra\res1\res/values-b+sr+Latn

All I did was change the activity create to this:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        player1.Initialize("player")
        player1.Prepare(player1.CreateLoopSource(File.DirAssets, "sport.mp4"))
    End If
    Activity.LoadLayout("1")
    SimpleExoPlayerView1.Player = player1
    player1.Play
End Sub

thoughts?

Edit: Nevermind, time to retire this spare little XP box. It was fun while I knew yee.
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Over on my Win7 machine with API26 I get the same problem.

Edit: I had multiple versions of everything, So I blew everything out and just downloaded the latest version of the SDK stuff as well as the API, and now it compiles.

Just to be rewarded with this:
java.lang.NumberFormatException: For input string: "sport.mp4"
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1306)


So at least I am getting somewhere now.
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I fixed it by fixing my statement to this:

B4X:
player1.Prepare(player1.CreateLoopSource(player1.CreateFileSource(File.DirAssets, "sport.mp4"),-1))

But, I still need to figure out a way to get rid of the player controls. When you start the video, or tap it, they pop up. I need them gone...

Edit: I got it. Sorry for all the posts. I turned off the Controller section of the customview. and that worked.
 
Last edited:
Upvote 0
Top