0

IR trigger sets off random playlist

Can anyone help wit a project please?

I am setting up a looping screen saver. When triggered with a connected IR sensor, I would like the player to randomly either play video 2 or do nothing and continue to play the screen saver.

As an alternative, resulting in the same effect the random could chose to play video 2 or play the screensaver video.

Can this be done using Brightauthor or will it require a script?

Thank you all in advance.

19 comments

  • 0
    Avatar
    Bright Scripters

    Typically, random behavior would be implemented with a script, or a BrightAuthor plugin.

    You could however implement random-like behavior, using the followin ingredients:

    • Timers
    • Event handlers
    • User Variable
    • Conditional Targets

     

    This mechanism would be placed in its own zone, that dosn't play any media, but rather changes a value of a User Variable.

    That user variable would be then used in the zone where media is played, to enable or disable playback of video 2.

    The two timers would be set to something like 3 sec each, or 2 sec, and 3 sec, to create the random-like behavior.

    I hope that helped

  • 0
    Avatar
    Italo Abri

    Brilliant, I was just going trough the tutorials, Thank you for the response, will try this - although seems complicated - need to work my way through this. But at least I am now hopeful. I'll report back on how I get on.

  • 0
    Avatar
    Bright Scripters

    Excellent!

    Please don't hesitate to share your progress. This is a safe and supportive place :)

  • 0
    Avatar
    Italo Abri

    Will do. I had a script created (autorun.brs), but unfortunately it has a bug and the author has gone on holiday, so cannot de-bug for it to work, hence why I am now looking at doing this myself using Brightauthor.

  • 0
    Avatar
    Italo Abri

    Hi there, Bright Scripters, Have been trying this pm, but have so far failed to get to a similar looking playlist. I have tried to find tutorials, but can't seem to get to what I need. Some further assistance would be appreciated. I am using the latest Brightauthor and latest firmware.

    Many thanks.

  • 0
    Avatar
    Bright Scripters

    Lets take a look at the original autorun.brs.

    Please place a link to the file here.

    Also, I'm not totally clear about the programming requirements. Please try to describe again.

  • 0
    Avatar
    Italo Abri

    Hi Thank you. So, this is what we are aiming to achieve:

    1. Video no1 plays in a loop continuously
    2. We have IR sensors connected to a Brightsign an LS422 (For testing I am using the LS422, but for the application will buy a new one)
    3. The next part is where we want a random action:
    4. When the sensor is interrupted we want it to either continue to play the Video1 OR play video2. Whilst I say random, it could be for every 3rd or 4th interruption video2 will play. 

    Hope the above makes sense. The script I have must have a bug as it partially works. It does everything OK, until you interrupt it. It will then play and for some reason appears to reboot the brightsign.

    I have an autorun.brs file, but can't seem to add it to this post. How can I get that file to you?

    Thank you for your help.

     

  • 0
    Avatar
    Italo Abri
  • 0
    Avatar
    Bright Scripters

    From looking at the script, it seems like it was designed to do more than what you have described.

    Implementing the described requirements, is very easy with BrightAuthor.

    You would need a User Variable, used as a counter that keeps track of sensor activations.

    The sensor event would have conditional targets, controlling when a trigger should start the video, and when it should be ignored.

    Basic stuff :)

     

    If you want to find the bug in the original script, be the hero of the day, and learn some cool stuff in the process, than keep reading.

    Debugging a script is easier with the use of the player's console. Typically that would be done over serial port, but the LS doesn't have one. Learn how to activate ssh on the player, and how to put the player in debug mode.

    https://docs.brightsign.biz/display/DOC/Telnet+and+SSH

    https://docs.brightsign.biz/display/DOC/BrightScript+Debug+Console

     

    The magic starts when you allow debugging with:

    >script debug on

     

    In theory, once your script steps on a bug, the player throws itself into the debugger, and would tell you in which line of code the issue is.

    Script away!

  • 0
    Avatar
    Italo Abri

    Hi there, thank you for your valuable input. If what I require is very doable with Brightauthor, then that would be the preferred way to go. I just need to figure out how to implement your suggestions using Brightauthor.!! I'm OK with simple interactive stuff, but this has turned out to be a bit more difficult to achieve even through i've referenced to the tutorial videos. I'm pleased you say "..basic stuff" it gives me hope! :-)

  • 0
    Avatar
    Chris Dotson

    Can you post a sample presentation with the event handlers example you mentioned? I think I have the idea, but would love to see if I'm on the right track.

  • 0
    Avatar
    Bright Scripters

    What I could do to further assist, is look at what you were able to build so far, and provide feedback.

    Please post a dropbox link, (or similar) to your current BrightAuthor project here.

  • 0
    Avatar
    Italo Abri

    Hi Chris, I'm still trying to learn event handlers and am reading up on the Brightauthor user manual, so don't have anything to show yet.

  • 0
    Avatar
    Italo Abri

    Hi Bright Scripters, be happy to share what ive done, as soon as I have made a start. I'm still trying to get to grips with the event handlers and the other parameters you mentioned. I'm not a dedicated software person, this is just something I have inherited and trying to get it working by end of week. :-) I would be more than happy to pay someone to do this for me and it wil also help me to understand the deeper aspects of Brightauthor.

  • 0
    Avatar
    Bright Scripters

    Event handlers in a nutshell:

    A simple presentation would have media files (Video, Image, Audio) that show on screen, that would transition from one to the next, by means of an event. An event would be something like a timeout, button pressed, screen touched, etc...

    In some cases, we want to respond to events without changing what is shown on the screen, and keep track of various states that the system is at. For example, if we want to change a User Variable from "Yes" to "No", when an event occurs. That is where Event Handler is used.

    For now you could ignore the Event Handler, and first implement your application so it plays video 2 every time. When that is complete, you can add the random-like mechanism with user variable and event handlers.

  • 0
    Avatar
    Italo Abri

    Thank you Bright Script. I am making some small headway. Will continue this afternoon and take you advice on board .. and report back!

  • 0
    Avatar
    Italo Abri

    Hi Bright Scriters. OK so the good news is I have video2 playing every time on trigger (touch screen). Just going to look at making this random now. Wish me luck!

  • 0
    Avatar
    Italo Abri

    I've cracked it!! As you quite rightly said Bright Scripters it was easy, once you know how. What I did was to create a video list and in there I placed the attract video and Video2 and checked the shuffle playback. So now, when triggered, it will play randomly either the attract video or video 2. This gives the appearance that the user was either successful in playing video 2 or not successful because as far as they are concerned the attract video was playing.

    The only thing I need to do now is to rename the attract video that pays during the random playback and shorten it, as it's too long before it returns to the real attract video.

    Thank you for your help and encouragement.

  • 0
    Avatar
    Bright Scripters

    With pleasure :)

Please sign in to leave a comment.