Hi all,
I am trying to create a custom script to play back a random video file on synchronized units.
The video files could be named 1.mp4, 2.mp4, etc..., to keep it simple.
I am currently using these scripts for easy synchronized playback, maybe some one could help me modify them to to select a random file and play it, and at the end of that video select another random file and play it, and at the end of that video select another random file and play it... and so on forever.
http://www.zachpoff.com/software/brightsign-video-sync-scripts/
And here below is an example code with random playback, but for a single screen queued with a button press. Maybe we could combine the two?
Would be so thankful if anyone could help!
debug=false
P = createobject("roMessagePort")
Vplayer = createobject("roVideoPlayer")
Button = createobject("roGpioControlPort")
Button.SetPort(p)
Vplayer.SetPort(p)
DIM vlist[20]
vlist[0]="video1.ts"
vlist[1]="video2.ts"
vlist[2]="video3.ts"
vlist[3]="video4.ts"
vlist[4]="video5.ts"
vlist[5]="video6.ts"
vlist[6]="video7.ts"
vlist[7]="video8.ts"
vlist[8]="video9.ts"
vlist[9]="video10.ts"
vlist[10]="video11.ts"
vlist[11]="video12.ts"
vlist[12]="video13.ts"
vlist[13]="video14.ts"
vlist[14]="video15.ts"
vlist[15]="video16.ts"
vlist[16]="video17.ts"
vlist[17]="video18.ts"
vlist[18]="video19.ts"
vlist[19]="video20.ts"
button.EnableInput(0)
not_currently_playing = true
if debug print "Ready"
Wait_to_play:
Msg = wait(0,p)
if debug print type(msg)
if type(msg) = "roVideoEvent" and msg.GetInt() = 8 then
vplayer.StopClear()
not_currently_playing=true
if debug print "Ready"
else if type(msg) = "roGpioButton" then
if debug print "Button: ";msg.GetInt()
if msg.GetInt() = 0 then
if not_currently_playing then
tmpFile = rnd(20) - 1
if debug print tmpFile; " = ";vlist[tmpFile]
ok = vplayer.PlayFile(vlist[tmpFile])
if ok = 0 then
if debug print "error playing file"
if debug print "Ready"
goto wait_to_play
else
not_currently_playing=false
endif
endif
endif
endif
goto wait_to_play