Skip to content

Instantly share code, notes, and snippets.

@alitteration
Forked from aabytt/lg webOS notes.md
Created January 19, 2022 07:44
Show Gist options
  • Save alitteration/7fe467204479b965c7e01b2326726d5e to your computer and use it in GitHub Desktop.
Save alitteration/7fe467204479b965c7e01b2326726d5e to your computer and use it in GitHub Desktop.
more useful stuff on lg webos

Playling a link with standard LG webOS player

  • id - id of the player app, com.webos.app.mediadiscovery for webOS 6.x, com.webos.app.photovideo for webOS 3.x-5.x, com.webos.app.smartshare for webOS 1.0-2.x
  • fullPath - url of the video file
  • fileName - name of the video displayed in player. Filename is remembered by the player to continue playback from exit timestamp

from a web app

webOS.service.request("luna://com.webos.applicationManager", {
           method: "launch",
           parameters: { "id": "com.webos.app.photovideo", "params": {"payload":[{
		"fullPath":"https://media.w3.org/2010/05/sintel/trailer.mp4",
		"artist":"",
		"subtitle":"",
		"dlnaInfo":{"flagVal":4096,"cleartextSize":"-1","contentLength":"-1","opVal":1,"protocolInfo":"http-get:*:video/x-matroska:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000","duration":0},
		"mediaType":"VIDEO",
		"thumbnail":"",
		"deviceType":"DMR",
		"album":"",
		"fileName":"trailer",
		"lastPlayPosition":-1}]}},
           onSuccess: function (inResponse) {
               console.log("The app is launched");
           },
           onFailure: function (inError) {
               console.log("Failed to launch the app");
               console.log("[" + inError.errorCode + "]: " + inError.errorText);
               return;
           }
       });

from shell

luna-send-pub -n 1 -f luna://com.webos.applicationManager/launch '{"id": "com.webos.app.photovideo", "params": {"payload":[{"fullPath":"https://media.w3.org/2010/05/sintel/trailer.mp4","artist":"","subtitle":"","dlnaInfo":{"flagVal":4096,"cleartextSize":"-1","contentLength":"-1","opVal":1,"protocolInfo":"http-get:*:video/x-matroska:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000","duration":0},"mediaType":"VIDEO","thumbnail":"","deviceType":"DMR","album":"","fileName":"trailer","lastPlayPosition":-1}]}}'

Turning screen backlight off (root)

# 1
luna-send -f -n 1 luna://com.webos.service.settings/setSystemSettings '{"category":"picture","settings":{"energySaving":"screen_off","energySavingModified":"true"}}'
//screen will turn back on with any remote key

# 2
luna-send -n 1 "luna://com.webos.service.tvpower/power/turnOffScreen" '{}'
luna-send -n 1 "luna://com.webos.service.tvpower/power/turnOnScreen" '{}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment