Closed elisiariocouto closed 5 years ago
I've found that passing a params
property with a target
key on the request
works. Is there any way of putting a website on fullscreen?
I've just done it by controlling the mouse cursor:
lgtv.on('connect', function () {
console.log('connected');
lgtv.getSocket('ssap://com.webos.service.networkinput/getPointerInputSocket',
function(err, sock) {
if (!err) {
const command = "move\n" + "dx:" + 11 + "\n" + "dy:-8\n" + "down:0\n" + "\n";
for (let i=0; i < 22; i++) {
sock.send(command);
}
setTimeout(()=>sock.send('click'), 1000);
}
}
);
I've managed to put the browser in fullscreen with the mouse cursor. Thanks @ciberado !
Thank you @ciberado for the fullscreen tip !
Wow, what a brilliant solution! Thx you @ciberado, you save my day!
Thanks for the script, it works 😄 However, when I try to add a disconnect to it, for some reason it is not working anymore. For example, the script I was hoping to use:
lgtv.on('connect', function () { lgtv.request('ssap://com.webos.applicationManager/listLaunchPoints', function (err, res) { var launchPoints = res.launchPoints; }); lgtv.request('ssap://system.launcher/launch', {id: 'com.webos.app.browser', target: 'http://google.com'}); lgtv.getSocket('ssap://com.webos.service.networkinput/getPointerInputSocket', function(err, sock) { if (!err) { const command = "move\n" + "dx:" + 11 + "\n" + "dy:-8\n" + "down:0\n" + "\n"; for (let i=0; i < 22; i++) { sock.send(command); } setTimeout(()=>sock.send('click'), 1000); } } ); lgtv.disconnect(); });
...will not move the cursor. Then, if I comment out lgtv.disconnect(); the cursor moves and puts browser to full screen. The script however runs until I force it to quit. What would be the correct syntax to gracefully close the connection?
Dear all, I'm new to this communitiy and stumbled over this community when searching for a solution for exact same challenge: Would like to launch a video on a LG TV in full screen mode but it only uses the full browser area. Ciberado's code would actually be a nice work around. Though I'm expierenced enough to apply the idea for my purpose. I use OpenHAB 3 and envision to write a script using the this code. Ciberado or anyone else: can pls. somebody help me with the following questions:
@ciberado or @odelma : In the meantime I managed to move and click to cursor and switch to full screen. I'm struggelling though with the same issue odelma has ... putting the disconnect command at the right spot. Can you pls help me with that? Thx a lot .... BMW999
Hello.
I've successfully managed to connect to my Web OS TV and I can open the web browser. Is it possible to open the web browser on a specific website?
Thanks in advance