**/ include 'smartTV.php'; /** * Create instance of TV * @param IP Address of TV * (optional) @param Port of TV (default is 8080) **/ $tv = new SmartTV('192.168.2.103'); // new SmartTV('192.168.2.103', 8080) /** * Set pairing key (if you don't know the pairing key * execute the method ..->displayPairingKey() and it will * be shown on your tv) * @param Key **/ $tv->setPairingKey(678887); // $tv->displayPairingKey(); /** * Authenticate to the tv * @except Login fails (wrong pairing key?) **/ try { $tv->authenticate(); } catch (Exception $e) { die('Authentication failed, I am sorry.'); } /** * Set your volume up. **/ $tv->processCommand(TV_CMD_VOLUME_UP); /**
<?php include 'PHP-LG-SmartTV/smartTV.php'; $tv = new SmartTV('192.168.0.11', 8080); $tv->setPairingKey(647492); try { $tv->authenticate(); } catch (Exception $e) { die('Authentication failed, I am sorry.'); } file_put_contents('screen.jpeg', $tv->queryData(TV_INFO_SCREEN));