Skip to content

Commit

Permalink
Add remote control capability on hbbtv terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
mlasak authored and FritzHeiden committed Jan 31, 2022
1 parent 235fe4e commit 80446d8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/wave/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<script src="lib/keycodes.js"></script>
<script src="lib/wave-service.js"></script>
<script src="lib/davidshimjs/qrcode.js"></script>
<script src="lib/hbbtv.js"></script>
</head>

<body>
Expand Down
34 changes: 34 additions & 0 deletions tools/wave/www/lib/hbbtv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(function() {

function setKeyset(mask) {
try {
var app = document.getElementById('appmgr').getOwnerApplication(document);
app.privateData.keyset.setValue(mask);
} catch (e) { }
}

function initApp() {
try {
var app = document.getElementById('appmgr').getOwnerApplication(document);
app.show();
} catch (e) { }
setKeyset(0x1 + 0x2 + 0x4 + 0x8 + 0x10);
}

function activate() {
// active only on hbbtv terminals
if (navigator.userAgent.toLowerCase().indexOf('hbbtv') === -1) {
return;
}
// create hbbtv objects and add to body
var appmgroipfcfg = '<object id="appmgr" type="application/oipfApplicationManager" style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px;">';

var elem = document.createElement("div");
elem.innerHTML = appmgroipfcfg;
document.body.appendChild(elem);

setTimeout(initApp, 1000);
}

setTimeout(activate, 1000);
})();

0 comments on commit 80446d8

Please sign in to comment.