0

Getting out of loop mode



If I have a video looping, and then I tell it to not loop anymore, it keeps looping. If I stop and restart the clip, then it doesn't loop. I'm trying to loop something an unspecified amount of times, then when I'm ready, branch to a new clip at the end of the first, looping clip.

I don't actually need to get this down right now for anything in particular. I'm just trying to figure out everything I can do with this box.

5 comments

  • 0
    Avatar
    RokuLyndon


    Can you post the script you are using? You can have the unit loop until it reaches an event. This is definitely doable. You can do this easily using a csv file, so a custom script isn't required.
  • 0
    Avatar
    travis


    The thing is, there is no video end event when you do SetLoopMode(True)



    SetLoopMode is preferable when you need seamless looping. There is a small stutter if you use events to start the clip every time the clip ends.
  • 0
    Avatar
    RokuLyndon


    The autorun.bas script uses setloopmode when playing back content in csv files, so I know what you are trying to do is doable.



    After you stop the video, are you resetting the loop mode when you start it again?
  • 0
    Avatar
    travis


    here's a stripped down version of the script.




    p = CreateObject("roMessagePort")
    serial = CreateObject("roSerialPort", 0, 38400)
    serial.SetLineEventPort(p)

    video=CreateObject("roVideoPlayer")
    video.SetPort(p)
    root="\\"
    filename = "vid1.mpg"


    wait_for_messages:
    msg = wait(0,p) ' Wait forever for a message.
    vmsg = val(msg) ' turns string 1 into number 1
    if(type(msg) = "roStreamLineEvent") then 'Accept serial messages


     if(vmsg = 1) then
    print "Start"
    ok = video.PlayFile(root+filename)

    else if(vmsg = 4) then
    print "Stop"
    ok = video.Stop()

    else if(vmsg = 6) then
    print "Looping on"
    ok = video.SetLoopMode(True)

    else if(vmsg = 7) then
    ok = video.SetLoopMode(false)
    print "Looping off"
    end if
    goto wait_for_messages

  • 0
    Avatar
    RokuLyndon


    Travis,

    You can't change the loop mode on the fly. So, if you change the loop mode, then you have to play the video again for the new loop mode to take effect.
Please sign in to leave a comment.