0

Play Random Syncronized Video

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

5 comments

  • 0
    Avatar
    Alex

    Hi,

    You can build everything you described in BrightAuthor. If you need assistance, let us know.

  • 0
    Avatar
    Tabor xyz

    Great!  I am somewhat familiar with BrightAuthor, I have no problem creating single channel and synchronized presentations, but I am not sure where to start with this.  So basic instructions would be great.

     

    I've attached an image of what I am going for which may be more clear than the following description.

    It's a 3 screen layout in portrait orientation.
    I have: 10x 1ch videos, 10x 2ch videos, 10x 3ch videos.  All are 1min.

    On power on, select 1 of 4 random layouts:
    Layout 1- for each screen randomly select a 1ch video and play it
    Layout 2-left screen shows a randomly selected 1ch video.  right two screens show a random 2ch video
    Layout 3-(reverse of above) left two screens show a random 2ch video. right screen shows a randomly selected 1ch video.
    Layout 4-all screens show a randomly selected 3ch video

    When video ends: select a new random layout with new random videos. Repeat forever.

     

    Any help would be amazing. Thank you!

  • 0
    Avatar
    Tabor xyz

    This attached image should be easy to understand

  • 0
    Avatar
    Romeo

    Hi,

    Please try the script available from the below link:

    http://brightsignnetwork.com/download/Romeo/StandaloneSyncScript.zip 

    This master scripts plays files in alphabetical order. The instructions are included with the zip file.

     

  • 0
    Avatar
    pseudolive

    Hi Tabor xyz,

    I nedd exactly the same script :

    2 players synchronizes and in each X videos with the same time. Loop randomly.

    Have you find the solution ?

    Best

Please sign in to leave a comment.