Broadcasting
console log "tunedirect success" ;}, function {console log "tunedirect error" ;} ; document getelementbyid 'test' innerhtml += json stringify channelobject ; } function onerror error { console log 'tizen tvwindow show error ' + json stringify error ; } tizen tvwindow show onsuccess, onerror, ["0px", "0px", "1920px", "1080px"], "main", "behind" ; tuning in dvb cable service sample code function onsuccess windowrect, type { var channelobject = { { broadcaststandard 'dvb', channeltype 'cdtv', modulationtype 'qam64', bandwidth '8mhz', frequency 722000, programnumber 1031, major 1, }; window webapis broadcast tunedirect channelobject, function {console log "tunedirect success" ;}, function {console log "tunedirect error" ;} ; document getelementbyid 'test' innerhtml += json stringify channelobject ; } function onerror error { console log 'tizen tvwindow show error ' + json stringify error ; } tizen tvwindow show onsuccess, onerror, ["0px", "0px", "1920px", "1080px"], "main", "behind" ; tuning in dvb satellite service sample code function onsuccess windowrect, type { var tuneoptionsdtv = {}; //trt 1 tuneoptionsdtv broadcaststandard = "dvb"; tuneoptionsdtv channeltype = "sdtv"; tuneoptionsdtv frequency = 11096000; tuneoptionsdtv satelliteid = "turksat_42e"; tuneoptionsdtv programnumber = 1; tuneoptionsdtv polarization = "pol_hl"; window webapis broadcast tunedirect tuneoptionsdtv, function {console log "tunedirect success" ;}, function {console log "tunedirect error" ;} ; document getelementbyid 'test' innerhtml += json stringify tuneoptionsdtv ; } function onerror error { console log 'tizen tvwindow show error ' + json stringify error ; } tizen tvwindow show onsuccess, onerror, ["0px", "0px", "1920px", "1080px"], "main", "behind" ; tuning in cable and terrestrial atsc or isdb services sample code const tuneatscoptions = [ { broadcaststandard "atsc", channeltype "cdtv", major 27, minor 11, frequency 243000, modulationtype "qam256" }, { broadcaststandard "atsc", channeltype "cdtv", ptc 27, programnumber 1, modulationtype "qam256" }, { broadcaststandard "isdb", channeltype "dtv", frequency 177000, modulationtype "isdb_t", major 10, minor 1, programnumber 72 } ]; function onsuccess windowrect, type { window webapis broadcast tunedirect tuneatscoptions[0], function {console log "tunedirect success" ;}, function {console log "tunedirect error" ;} ; document getelementbyid 'test' innerhtml += json stringify tuneatscoptions[0] ; } function onerror error { console log 'tizen tvwindow show error ' + json stringify error ; } tizen tvwindow show onsuccess, onerror, ["0px", "0px", "1920px", "1080px"], "main", "behind" ; webapis broadcast enablesubtitles this api enables or disables subtitles on dvb broadcasted content closed captions are only shown in full-screen mode sample code function enablesubtitles { var key = webapis tvinfo tvinfomenukey subtitle_onoff_key; var value = webapis tvinfo tvinfomenuvalue on; var onsuccess = function { console log "onsuccess subtitles enabled!" ; }; var onerror = function { console log "onerror subtitles not enabled!" ; }; webapis tvinfo setmenuvalue key, value, onsuccess, onerror ; } function disablesubtitles { var key = webapis tvinfo tvinfomenukey subtitle_onoff_key; var value = webapis tvinfo tvinfomenuvalue off; var onsuccess = function { console log "onsuccess subtitles disabled!" ; }; var onerror = function { console log "onerror subtitles not disabled!" ; }; webapis tvinfo setmenuvalue key, value, onsuccess, onerror ; } webapis broadcast clearratings this api removes age restrictions for watching tv programs sample code function clearrating { console log "[clearrating] function call" ; var onsuccess = function { console log "[clearrating] success " ; }; var onerror = function error { console log "[clearrating] code " + error code + " error name " + error name + " message " + error message ; }; log "[clearrating] window webapis broadcast object " + window webapis broadcast ; window webapis broadcast clearrating onsuccess, onerror ; } webapis broadcast getcurrentsubtitle this api returns the current subtitle index, starting from 0 sample code function getcurrentsubtitle { console log "[getcurrentsubtitle] function call" ; var getcurrentsbt = null; try { console log "[getcurrentsubtitle] window webapis broadcast object " + window webapis broadcast ; getcurrentsbt = window webapis broadcast getcurrentsubtitle ; } catch e { console log "[getcurrentsubtitle] call syncfunction exception [" + e code + "] name " + e name + " message " + e message ; } if null !== getcurrentsbt { console log "[getcurrentsubtitle] index " + getcurrentsbt index + " language " + getcurrentsbt language + " mode " + getcurrentsbt mode ; } } webapis broadcast setcurrentssubtitle this api determines the current subtitle track the "current" parameter is of the "long" type and ranges from 0 to the length of the subtitle track table - 1 sample code function setcurrentsubtitle current { console log "[setcurrentsubtitleindex] function call" ; var onsuccess = function { console log "[setcurrentsubtitleindex] success " ; }; var onerror = function error { console log "[setcurrentsubtitleindex] error code " + error code + " error name " + error name + " message " + error message ; }; window webapis broadcast setcurrentsubtitleindex current, onsuccess, onerror ; } webapis broadcast gettotalsubtitle this api returns information about the subtitle tracks available on currently tuned channel sample code function gettotalsubtitle { console log "[gettotalsubtitle] function call" ; var i; try { gettotalsbt = window webapis broadcast gettotalsubtitleinfo ; } catch e { console log "[gettotalsubtitle] call syncfunction exception [" + e code + "] name " + e name + " message " + e message ; gettotalsbt = null; } if null != gettotalsbt { totalsubtitleslength = gettotalsbt length; for i =0; i < gettotalsbt length; i++ { console log "index "+ gettotalsbt[i] index + " language " + gettotalsbt[i] language+ " mode " + gettotalsbt[i] mode ; } } } webapis broadcast getcurrentaudio this api returns the current audio track index, starting from 0 sample code function getcurrentaudio { console log "[getcurrentaudio] function call" ; var getcurrentaudio = null; try { console log "[getcurrentaudio] window webapis broadcast object " + window webapis broadcast ; getcurrentaudio = window webapis broadcast getcurrentaudioinfo ; } catch e { console log "[getcurrentaudio] call syncfunction exception [" + e code + "] name " + e name + " message " + e message ; } if null !== getcurrentaudio { console log "[getcurrentaudio] index " + getcurrentaudio index + ", type " + getcurrentaudio type + ", language " + getcurrentaudio language ; } } webapis broadcast setcurrentaudio this api determines the current audio track the "current" parameter is of the "long" type and ranges from 0 to the length of the audio track array - 1 sample code function setcurrentaudio current { console log "[setcurrentaudio] function call" ; var onsuccess = function { console log "[setcurrentaudio] success " ; }; var onerror = function error { console log "[setcurrentaudio] error code " + error code + " error name " + error name + " message " + error message ; }; console log "[setcurrentaudio] window webapis broadcast object " + window webapis broadcast ; window webapis broadcast setcurrentaudio current,"", onsuccess, onerror ; } webapis broadcast gettotalaudio this api returns information about the audio tracks available on currently tuned channel sample code function gettotalaudio { console log "[gettotalaudio] function call" ; try { gettotalaud = window webapis broadcast gettotalaudioinfo ; } catch e { console log "[gettotalaudioinfo] call syncfunction exception [" + e code + "] name " + e name + " message " + e message ; gettotalaud = null; } if null !== gettotalaud { totalaudioslength = gettotalaud length; console log "size of audio = " + totalaudioslength ; var i; for i =0; i < totalaudioslength; i++ { console log "index "+ gettotalaud[i] index + ", type " + gettotalaud[i] type + ", language " + gettotalaud[i] language ; } } else { console log "[gettotalaudioinfo] result data = null" ; } } webapis broadcast sethoteldrmforensic data this api provides methods to set forensic data for security by watermark no other drm apis are provided for here playing tv services with drm is based on setting the appropriate value for drm in the factory menu hotel option sample code function sethoteldrmforensicdata { console log "[sethoteldrmforensicdata] function call" ; var onsuccess = function val { console log "[sethoteldrmforensicdata] success " + val result ; }; var onerror = function error { console log "[sethoteldrmforensicdata] code " + error code + " error name " + error name + " message " + error message ; }; console log "[sethoteldrmforensicdata] window webapis broadcast object " + window webapis broadcast ; window webapis broadcast sethoteldrmforensicdata "abcdefgh", onsuccess, onerror ; } closed captions atsc for broadcast you can enables or disables closed captions on atsc broadcasted content using the samsung product tvinfo api closed captions are only shown in full-screen mode sample code // call sequence for enabling closed captions in atsc broadcasted content var key = webapis tvinfo tvinfomenukey caption_onoff_key; console log 'key '+ key ; var value = webapis tvinfo tvinfomenuvalue caption_on; console log 'value '+ value ; var onsuccess = function { console log "captions enabled" ; }; var onerror = function { console log "error has occurred" ; }; webapis tvinfo setmenuvalue key, value, onsuccess, onerror ; // call sequence for disabling closed captions in streaming var key = webapis tvinfo tvinfomenukey caption_onoff_key; console log 'key '+ key ; var value = webapis tvinfo tvinfomenuvalue caption_off; console log 'value '+ value ; var onsuccess = function { console log "captions disabled" ; }; var onerror = function { console log "error has occurred" ; }; webapis tvinfo setmenuvalue key, value, onsuccess, onerror ;