0

Scripting Help



I would like some help on figuring out how to get started with using BrightScript. I have read both the Brightscript Reference Guide and the Object Reference Manual and I have not been able to get anything to work.

My file is called autorun.brs just like it says to do in the user guide.

I have then also copied a sample of code to just play a video in a zone.

The following is what I am using:

debug = true v=CreateObject("roVideoMode") v.SetMode("1920x1080x60i") EnableZoneSupport(true) r=CreateObject("roRectangle", 60, 60, 1386, 800) v=CreateObject("roVideoPlayer") v.SetRectangle(r) v.SetLoopMode(1) v.SetViewMode(2) v.SetAudioOutput(2) v.PlayFile("Amazon_1080.mpg")

I am using scripting because eventually I will need to accomplish things playlists won't allow. I have just chosen to start small to since even at this basic stage I am having problems.

And yes, I do have a video that I have called Amazon_1080.mpg.

9 comments

  • 0
    Avatar
    RokuLyndon


    If you haven't updated to 3.1, it won't play .mpg files.



    And, you can try it without enabling zones, if you aren't using zones. Finally, there needs to be a loop of some kind or the script will just exit. So, the last two lines puts the script in a loop.  I can also send you something that will help with testing on your computer. Please send me an email at <!-- e --><a href="mailto:support@brightsign.biz">support@brightsign.biz</a><!-- e -->.





    mode=CreateObject("roVideoMode")

    mode.SetMode("1920x1080x60i")



    v=CreateObject("roVideoPlayer")

    v.SetLoopMode(1)

    v.SetViewMode(2)

    v.SetAudioOutput(2)

    v.PlayFile("Amazon_1080.mpg")



    loop:

    goto loop
  • 0
    Avatar
    zancroft


    The new code you posted didn't work, nothing is showing up on the screen. I just copied what you had posted over what I had, should I have added or kept anything else?



    Also, I forgot to mention, in case it matters, this is being displayed on an HD1010.



    And I have updated it to the most current version.
  • 0
    Avatar
    RokuLyndon


    Ok, I wasn't paying attention. The object you use to create the video mode setting, is different from the one you use for playing videos. SEe the changes I made. I add a roVideoPlayer object, and changed the name of the videomode object.
  • 0
    Avatar
    zancroft


    I don't understand your response. Just using the code you provided didn't display the video. Should I use your code in conjunction with some of my old code?
  • 0
    Avatar
    RokuLyndon


    Please email me the actual file you are using at <!-- e --><a href="mailto:support@brightsign.biz">support@brightsign.biz</a><!-- e -->.
  • 0
    Avatar
    zancroft


    I hadn't noticed you edited your previous post. I've changed the brs file to be then one you sent me, but the video is still not showing up.



    I have tested this video on this unit and it plays just fine if it's through a playlist or autoplay. I have also tried using different monitors to test the script and it doesn't play on any of them.
  • 0
    Avatar
    RokuLyndon


    Let me know when's a good time to reach you by phone. Send me an email.
  • 0
    Avatar
    zancroft


    I got the video to show up, I had to use another video file, so I’ve moved on. I am now stuck trying to use the touch screen. I am able to use the touch screen.



    \I have noticed that the x and y coordinates are flipped. The origin point for the touch screen is on the lower right corner instead of the upper left, as it is for the video and images zones.
  • 0
    Avatar
    almex

    Ok, I wasn't paying attention. The object you use to create the video mode setting, is different from the one you use for playing videos. SEe the changes I made. I add a roVideoPlayer object, and  Amazon bin shopping locations near me changed the name of the videomode object.

Please sign in to leave a comment.