This document describes how to play, access, and use television services broadcast on satellite, cable, or terrestrial environment through the Samsung Product Broadcast API.
The API provides the ability to tune in to a broadcasting channel, get information about a channel's possible subtitles, closed captions, and audio tracks, and the ability to select the desired track according to the user's needs.
Prerequisites
Device with DVB / ATSC / ISDB tuner, connected to an antenna.
To play broadcasting content, use the Broadcast API.
To use this API, add the following code to the "index.html" file.
Get the version of the Samsung Prodct Broadcast API.
webapis.broadcast.enableDataService
Enable the broadcast data service, which provides support for subtitles or captions and other broadcast functionalities. This method should be called at the beginning of the web application.
webapis.broadcast.disableDataServce
Disable the broadcast data service. This method should be called before the web application finishes.
webapis.broadcast.tuneDirect
Directly tune in to the selected broadcasting channel.
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.
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.
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.
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).
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);
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.