top

How to show the live TV signal in some area of your app?

Published 2014-10-27 | (Compatible with SDK 3.5,4.5,5.0,5.1 and 2012,2013,2014 models)

Embedding the TV signal inside the application

In some countries, there is a possibility to display the scaled TV broadcast signal in some area of the screen, while the rest shows some other content. In this document you can find the implementation details on resizing the TV live signal.

Source Files

Note

The files needed for the sample application are here.

Setting the live signal size

There is a specific function - setRect - of the window, that can resize the live TV signal to fit in some defined part of the screen.

Here is an example code of how to use it.

  1. In index.html file:

    <script type="text/javascript" language="javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js"></script>
    
  2. In Main.js file:

    Main.onLoad = function() {
        widgetAPI.sendReadyEvent();
        window.onShow = showHandler;
    };
    
    var showHandler = function() {
        try {
            webapis.tv.window.getAvailableWindow(successCB, errorCB);
        } catch(error) {
            console.log(error.name);
        }
    };
    
    function successCB(windows) {
        webapis.tv.window.setRect({
            left : 30, top : 30, width : 384, height : 216
        }); 
    }
    
    function errorCB(error) {
        console.log(error.name);
    }
    

Important

All applications of that type need a formal agreement from the broadcasters. It is recommended to contact your local Content Manager before starting the development process.