2.0.2 • Published 7 years ago

d2h-smartconnect-util v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Videocon d2h - SmartConnect Utility Library

Videocon d2h - SmartConnect Utility Library, It provides some utility events and methods for the development of SmartApps for Videocon d2h Smart Connect platform.

Getting Started

Videocon d2h - Smart Connect utility Library is supported for NodeJS and Javascript environments. It provides events and methods for Network, RemoteApp and Communication between STB Device to Remote App. Before going to integrate the same make sure you have Videocon d2h STB Device (HD5555-RF or HD6666-RF) for Development purpose and an authenticated token and appid is provided by Videocon d2h Ltd.

Prerequisites

  • Videocon d2h STB Device (HD5555-RF or HD6666-RF)
  • AppId : App ID Approved by Videocon d2h Ltd
  • AccessToken : Access Token of the App Approved by Videocon d2h

If you don't have AppId and AccessToken write an email to videocond2hstore@gmail.com

Installation


  • NodeJS
    npm install d2h-smartconnect-util@latest
    or
    npm i d2h-smartconnect-util
  • Plain JavaScript
    <script type="text/javascript" src="./d2h-smartconnect-util-2.0.2.min.js"></script>

Initialization


Once this library is successfully installed on the project, We need to initialize the library with the correct access token and app id (recieved from Videocon d2h Ltd).Make sure initialize the library when your app is ready so for example : Initializing it after getting DOMContentLoaded event.

document.addEventListener('DOMContentLoaded', function() {
    d2hSmartConnect.init({
      appId: "<<APPID>>",
      accessToken: "<<ACCESS_TOKEN>>",
      scope: "default"
    });
});

Once Initialized the app is ready to use the methods and recieve the events.

Events:


This library will trigger total five events for connection and text communication between STB App and Smart Remote App.

i) onD2hRemoteOnline

This library will trigger onD2hRemoteOnline event when Smart Remote App is Connected with Set Top Box Device via WiFi.

window.addEventListener("onD2hRemoteOnline", function(event) {
    console.log("Smart Remote App is Connected.");    
});
ii) onD2hRemoteOffline

This library will trigger onD2hRemoteOffline event when Smart Remote App is disconnected from the Set Top Box Device.

window.addEventListener("onD2hRemoteOffline", function(event) {
    console.log("Smart Remote App is disconnected.");    
});
iii) onD2hSTBOnline

This library will trigger onD2hSTBOnline event when Set Top Box Device is connected with the Internet.

window.addEventListener("onD2hSTBOnline", function(event) {
    console.log("STB Device is Connected to the Network/Internet.");    
});
iv) onD2hSTBOffline

This library will trigger onD2hSTBOffline event when Set Top Box Device is disconnected from the Internet.

  window.addEventListener("onD2hSTBOffline", function(event) {
      console.log("STB Device is disconnected from the Network/Internet.");   
  });
v) onD2hRemoteTextReceived

This library will trigger onD2hRemoteTextReceived event when Set Top Box Device received text from Smart Remote App either from Remote App Keyboard or Microphone.

  window.addEventListener("onD2hRemoteTextReceived", function(event) {
      console.log("Text Received from SmartRemote Device is : "+event.detail.text);
  });

Methods:


i) isNetworkConnected

isNetworkConnected method is used to identify, STB device is connected to internet or not. it return boolean value, true for connected state and false for disconnected state.

var netwrkStatus = d2hSmartConnect.isNetworkConnected();
console.log("STB Network Status : "+netwrkStatus);
ii) isSmartRemoteConnected

isSmartRemoteConnected method is used to identify, Smart Remote App is connected with the STB device or not. it also return boolean value, true for connected state and false for disconnected state.

var conStatus = d2hSmartConnect.isSmartRemoteConnected();
console.log("Remote and STB Connection Status : "+conStatus);
iii) smartRemoteKeyboard

smartRemoteKeyboard method is used to open the mobile keyboard for accepting input from d2h Smart Remote App. Once this method is invoked the text value will be recieved on the event onD2hRemoteTextReceived. It will only work if STB Device and Smart Remote is connected.

d2hSmartConnect.smartRemoteKeyboard();
iv) smartRemoteMic

smartRemoteMic method is used to open the Voice Input for accepting input from d2h Smart Remote App. Once this method is invoked the VOice is converted to text and the text value will be recieved on the event onD2hRemoteTextReceived. It will only work if STB Device and Smart Remote is connected.

d2hSmartConnect.smartRemoteMic();

About Authors


Videocon d2h, a pioneer amongst the DTH service providers has won the hearts of millions over the years with its quality services that are constantly revolutionizing the entertainment industry. Since the last 4 years, Videocon d2h has continuously been India’s Fastest Growing DTH Service. It launched its services in 2009 and went pan India by 2010. It has a gross subscriber base of 17 million in span of 7 years since its launch.

Videocon d2h is the first Indian media company to be listed on NASDAQ. Enhancing entertainment and TV viewing for our customers has always been a priority for Videocon d2h. This made us come up with some of the best technological innovations like India’s first 4K Ultra HD Channel, Wireless DTH Headphones, Radio Frequency DTH Remote and a 1000 GB HD DVR, constantly redefining the TV viewing experience.

License


Copyright Videocon d2h Pvt Ltd
Copyright (c) 2016 - Videocon d2h Pvt Ltd, all rights reserved

This project is licensed as per the LICENSE.md file.

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago