Skip to content

Instantly share code, notes, and snippets.

@mattkanwisher
Created January 11, 2020 18:28
Show Gist options
  • Save mattkanwisher/62ae049cd770fc5d86cb24c9077d4eff to your computer and use it in GitHub Desktop.
Save mattkanwisher/62ae049cd770fc5d86cb24c9077d4eff to your computer and use it in GitHub Desktop.
Launch Youtube on LG TV to a specific video
// To run
// npm install lgtv2
// node YouTube_LG_WebTV.js
var lgtv = require("lgtv2")({
url: 'ws://192.168.1.XX:3000' //Change XX to whatever the ip of your television is
});
lgtv.on('error', function (err) {
console.log(err);
});
lgtv.on('connect', function () {
console.log('connected');
lgtv.request('ssap://system.launcher/launch', {id: 'youtube.leanback.v4', "contentId": "w7M72xKk6mk" }, function (err, res) {
console.log('launch points', res);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment