Video playing from random value

composer

#1

Hi guys,
I want my video player asset to play a video randomly from a set of files. I have this 10 files (video1.mp4 , video2.mp4 etc) and an Excel file with the comma separated list:
video1.mp4, video2.mp4, video3.mp4, video4.mp4, video5.mp4, video6.mp4, video7.mp4, video8.mp4, video9.mp4, video10.mp4
A Random from list interface asset successfully sort out a random name from there (i.e. video6.mp4)
Now, my video asset file field has a binding to Random from list result.

Too bad, the file can’t be found.

The files are the Files/Videos/ folder.
Should I place them in a different position?
Why the player fails to play the files?


#2

You need to have the value for the video asset be the full image path. For example
’C:\Users[your user name]\Desktop\Video1.mp4’ or whatever the file path of your videos are.
This is what should be referrenced in your excel sheet not just the video name.

Also, you could have directly put the video paths in the random from list interface asset without using the excel spreadsheet since you only have 10 items.

Hope this makes sense.

Let me know if you need more help.


#3

Hi @luca_carida,

Another option could be to use relative path from an Excel file, as explained in this article with an Index column going from 1 to 10. Then use the Number generator to filter the Excel file and get only 1 row to decide which video you have to play.

Seb


#4

Hi Chloe, hi Seb,
since path in my Composer machine is different form the path in the Player one, relative path would be easier.

I will that precise article as reference.

One question: I suppose the number generator generates a number each time the scene is loaded. Is there a way to force it to generate a new random number without reloading the whole scene?

This experience will be running on a quite big videowall with other contents and, in principle, with no interactivity. So it would be nice to trigger random “local” events calling several random numbers without having to reload the whole scene.

Thank you for your support,
Luca


#5

Actually the Number Generator is an Interface Asset, thus not related to one scene or another. It has a random value when you launch the experience, then it’s up to you to call its generate number action to generate a new random number among its boundaries.

Seb