0

Available script services?



I am unable to grasp the complexities of scripting, and am looking for available script services you offer/recommend. Here is my scenario: Brightsign 410: Looping video plays until button 0 is pressed (video1). Then it chooses a video from a random playlist (video2 - video14). When that video completes, it automatically commences to choose another random video from a second playlist (video15 - video27). After that video, returns to the original looping state (video1), BUT Button 0 is no longer active. Button 1 is active. Looping video plays until button 1 is pressed (video1). Chooses a video from a third random playlist (video28 - video60). Return to main looping state (video1). Button 0 is again active, but button 1 is inactive. Any help or recommended script service providers would be appreciated.

3 comments

  • 0
    Avatar
    RokuLyndon


    I haven't had time to debug this fully, but this is one way this could be done.

    debug=true
    P = createobject("roMessagePort")
    Vplayer = createobject("roVideoPlayer")
    Button = createobject("roGpioControlPort")
    Button.SetPort(p)
    Vplayer.SetPort(p)

    DIM vlist[60]
    vlist[0]="video1.ts" 'attract video

    p1count=13
    vlist[1]="video2.ts" 'playlist 1
    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"

    p2count=13
    vlist[14]="video15.ts" 'playlist2
    vlist[15]="video16.ts"
    vlist[16]="video17.ts"
    vlist[17]="video18.ts"
    vlist[18]="video19.ts"
    vlist[19]="video20.ts"
    vlist[20]="video21.ts"
    vlist[21]="video22.ts"
    vlist[22]="video23.ts"
    vlist[23]="video24.ts"
    vlist[24]="video25.ts"
    vlist[25]="video26.ts"
    vlist[26]="video27.ts"

    p3count=32
    vlist[27]="video28.ts" 'playlist3
    vlist[28]="video29.ts"
    vlist[29]="video30.ts"
    vlist[30]="video31.ts"
    vlist[31]="video32.ts"
    vlist[32]="video33.ts"
    vlist[33]="video34.ts"
    vlist[34]="video35.ts"
    vlist[35]="video36.ts"
    vlist[36]="video37.ts"
    vlist[37]="video38.ts"
    vlist[38]="video39.ts"
    vlist[39]="video40.ts"
    vlist[40]="video41.ts"
    vlist[41]="video42.ts"
    vlist[42]="video43.ts"
    vlist[43]="video44.ts"
    vlist[44]="video45.ts"
    vlist[45]="video46.ts"
    vlist[46]="video47.ts"
    vlist[47]="video48.ts"
    vlist[48]="video49.ts"
    vlist[49]="video50.ts"
    vlist[50]="video51.ts"
    vlist[51]="video52.ts"
    vlist[52]="video53.ts"
    vlist[53]="video54.ts"
    vlist[54]="video55.ts"
    vlist[55]="video56.ts"
    vlist[56]="video57.ts"
    vlist[57]="video58.ts"
    vlist[58]="video59.ts"
    vlist[59]="video60.ts"



    button.EnableInput(0)
    not_currently_playing = true
    index=0
    buttonPressed=99
    button0Active=true
    button1Active=false

    Play:
    vplayer.PlayFile(vlist[index])
    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()
    if button0Active and index=0 then
    goto play

    else if button0Active then
    button0Active=false
    index = rnd(p2count)+p2count
    if debug print index; " is current index."
    button1Active=true
    goto play
    else if button1Active then
    button1Active=false
    index=0
    endif
    if debug print "Ready"

    else if type(msg) = "roGpioButton" then
    buttonPressed=msg.GetInt()
    if debug print "Button: ";buttonPressed


    if button0Active and buttonPressed=0 then
      button1Active=false

    index = rnd(p1count)
    if debug print index; " = ";vlist[index]
    ok = vplayer.PlayFile(vlist[index])

    if ok = 0 then
    if debug print "error playing file"
    if debug print "Ready"
    goto wait_to_play
    endif



    else if button1Active and buttonPressed=1 then
    button0Active=false

    index = rnd(p3count)+27
    if debug print index; " = ";vlist[index]
    ok = vplayer.PlayFile(vlist[index])

    if ok = 0 then
    if debug print "error playing file"
    if debug print "Ready"
    goto wait_to_play
    endif
    endif
    endif

    goto wait_to_play

  • 0
    Avatar
    gharsh


    Thank you very much! I did not expect to be offered a solution! It is VERY appreciated.

    It appears that it loops video1 until button0 is pressed (correct), then it randomly selects a video (correct), then after it plays randomly selects from playlist 2 (correct), and (incorrect) then the screen goes blank with no way of proceeding.

    I guess it would need to return to vid1 loop after playlist 2 until button 1 is pressed to play random from list 3. Then afterward return to vid1 loop (basically resets to repeat).

    Thanks in advance for the help!
  • 0
    Avatar
    gharsh


    I've tried figuring out what's going on with the sample script provided, but so far to no avail. Anyone out there with scripting experience that can take on the challenge? The script that Roku so generously created does steps 1-3 fine, but it does not return to the looping video and the buttons don’t do anything. I’m stuck on a blank screen and have to unplug the unit.

    To reiterate, here is the functionality I want:

    1- A Looping video plays until button 0 is pressed ( lets call it video1).

    2- When button 0 is pressed, it chooses a random video from a playlist (video2 - video14).

    3- When that random video completes, it automatically commences to choose another random video from a second playlist (video15 - video27).

    4- After that video completes, it returns to the original looping state (video1), BUT
    Button 0 is no longer active (to prevent retriggering).
    Button 1 is active.

    5- The looping video (video1) plays until button 1 is pressed.

    6- Then it chooses a random video from a third playlist (video28 - video60).

    7- When the video completes playing, return to main looping state (video1).

    Button 0 is again active, but button 1 is inactive (basically resets the initial state).

    Many thanks.
Please sign in to leave a comment.