Skip to content

Legacy API: TVWindow

Hyojin Kim edited this page Mar 21, 2017 · 3 revisions

For converting TVWindow API of Legacy to TOAST API, please refer to the followings.

If you want more information, please refer to toast.tvwindow

setSource

  • Before

    /* webapis */
    webapis.tv.window.setSource({
        type: 'TV',
        number: 1
    }, function() {}, function() {}, 0);
    /* SEF */
    var sef= document.getElementById("sef");
    sef.open('Window', '1.0', 'Window');
    sef.Execute('SetSource', 0);
  • After

    toast.tvwindow.setSource({
        type: 'TV',
        number: 1
    }, function() {}, function() {});

getSource

  • Before

    /* webapis */
    var sourceInfo = webapis.tv.window.getSource(0);
    /* SEF */
    sef.Execute('GetSource', 0);
  • After

    toast.tvwindow.getSource(function() {}, function() {});  

show

  • Before

    /* webapis */
    webapis.tv.window.setRect({
            left: 0,
            top: 0,
            width: 960,
            height: 540
        }, 0);
    webapis.tv.window.show(0);
    /* SEF */
    sef.style.left = '0px';
    sef.style.top = '0px';
    sef.style.width = '960px';
    sef.style.height = '540px';
    sef.style.visibility = "visible";
  • After

    toast.tvwindow.show([0, 0, 960, 540], function() {}, function() {});   

hide

  • Before

    /* webapis */
    webapis.tv.window.setSource({
        type: 'MEDIA',
        number: 1
    }, function() {}, function() {}, 0);
    webapis.tv.window.hide(0);
    /* SEF */
    sef.Execute('SetSource', 43);
    sef.style.visibility = 'hidden';
  • After

    toast.tvwindow.hide(function() {}, function() {});

getRect

  • Before

    Not supported
  • After

    toast.tvwindow.getRect(function() {}, function() {});
Clone this wiki locally