0

How to change orientation of BrightSign device (example LS424)?

Hello,

I'm looking for method or package what can help me to change orientation of BrightSign device (LS424 for example) using Javascript.

additional information: i use autorun.brs what create just alone roHtmlWidget and load local file.

Sub Main()
url$ = "file:///app/index.html"
rect = CreateObject("roRectangle", 0, 0, 1920, 1080)
config = {
nodejs_enabled: true,
brightsign_js_objects_enabled: true,
javascript_enabled: true,
url: url$,
hwz_default: hwz$
}
html = CreateObject("roHtmlWidget", rect, config)
html.AllowJavaScriptUrls({ all: "*" })
html.Show()
End Sub

I tried change this file using nodejs (readFile/writeFile) but file is not re-writed and after reboot file at same state as was before changing.

1 comment

  • 0
    Avatar
    Alexander Shipin

    Oh, Im sorry, but i found solution. I missed temp_variable for changed data :)

    You can use this method for resolve your problem, if you need change autorun file "on fly".

    But dont forget about reboot after it to accept changes.

    const fs = require("fs")

    let autorun = fs.readFileSync("/storage/sd/autorun.brs").toString("utf8");
    let changedInfo = autorun.replace("0, 0, 1920, 1080", "0, 0, 1080, 1920");
    fs.writeFileSync("/storage/sd/autorun.brs", changedInfo);

    Or you can add in config

    Sub Main()
    url$ = "file:///app/index.html"
    rect = CreateObject("roRectangle", 0, 0, 1920, 1080)
    config = {
    nodejs_enabled: true,
    brightsign_js_objects_enabled: true,
    javascript_enabled: true,
    url: url$,
    hwz_default: hwz$,
    transform: rot90
    }
    html = CreateObject("roHtmlWidget", rect, config)
    html.AllowJavaScriptUrls({ all: "*" })
    html.Show()
    End Sub
Please sign in to leave a comment.