Introduction
This article is designed to help developers who have used previous APIs get up to speed quickly using the javascript API for the device.
The device can be managed via DHCP as usual, or via the Amino Orchestrate management platform (ask about a demo) or loaded locally via USB.
Once your device is added to your DHCP or to the Orchestrate platform you can configure it via the graphical user interface in Orchestrate or via a .ini file where the main expected directives are:
1 - firmware file location
2 - firmware version
3 - a) the url of your portal or web server
or
b) the url of your channel lineup file if using the built-in channel zapper feature
additionally
c) the package id of your client app if in use
For example:
firmware_upgrade.url=http://192.168.68.18:8080/aosp/h200/25.3.2022.3R.dev.zip
firmware_upgrade.version="25.3.2022.3R"
tvapp.package_id="com.aminocom.browser"
webapp.homepage="https://portal.yourweburl.com/"
webapp.lineup_url="http://192.168.68.18:8080/lineup.json"
Once you have pointed the H200 to your web portal you can then use standard html and javascript to create the experience you want a user to have.
The H200 also has a local server built-in which can respond to REST API calls. This is referred to by the acronym EELM so check out that API if you have local networks and want to send localised commands that don't go out of the network.
H200 Enable Enterprise Local Management (EELM) Server OpenAPI Specification
To use our javascript API see the API documentation.
EnableJS JavaScript APIs
Here are a couple of examples of common actions and we also provide the sample code to our built-in zapper application which is available to H200 SDK customers in the Amino support portal sdk download area.
Channel Up/Down, Play/Pause video example:
<script type="text/javascript">
let player = new ENABLE.player();
player.setSource("https://cmafref.akamaized.net/cmaf/live-ull/2006350/akambr/out.mpd");
function setupKeyEvent() {
let keyHandler = function(e) {
let key = e.key;
if (key === ENABLE.input.KEY_CHANNELUP) {
player.setSource("https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd");
}
else if(key === ENABLE.input.KEY_CHANNELDOWN) {
player.setSource("https://cmafref.akamaized.net/cmaf/live-ull/2006350/akambr/out.mpd");
}
else if (key === ENABLE.input.KEY_PLAY) {
player.play(1);
}
else if (key === ENABLE.input.KEY_PAUSE) {
player.play(0);
}
}
document.addEventListener("keydown", keyHandler);
}
setupKeyEvent();
</script>
Background image with video in a window:
<script type="text/javascript">
let player = new ENABLE.player();
player.setSource("https://cmafref.akamaized.net/cmaf/live-ull/2006350/akambr/out.mpd");
player.setVideoRect(960, 0, 960, 540);
</script>
<style>
body {
margin: 0px;
width: 1920px;
height: 1080px;
background-image: url(./videoBg.png);
background-repeat: no-repeat;
}
</style>