Meego Wiki
Views

TV Browser Javascript API

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "= Tizen TV Browser Web API = The Tizen TV Web API refers and follows to the Open IPTV DAE ( [http://www.oipf.tv/docs/Release2/V2.1/OIPF-T1-R2-Specification-Volume-5-Declarative-A...")
(Tizen TV Browser Web API)
Line 7: Line 7:
== 1. Tuner and Broadcasting API ==
== 1. Tuner and Broadcasting API ==
-
* '''Reference''': Open IPTV DAE specfication Section 7.13 [[BR]]
+
* '''Reference''': Open IPTV DAE specfication Section 7.13
-
* '''Status''': Under development [[BR]]
+
* '''Status''': Under development
* '''Overview''':
* '''Overview''':
The broadcasting API describes the video/broadcast embedded object needed to support display and control by a DAE application of scheduled content received over local tuner functionality available to an OITF, including the conveyance of the channel list to the server. The term “tuner” is used here to identify a piece of functionality to enable switching between different types of scheduled content services that are identified through logical channels. This includes IP broadcast channels, as well as traditionalbroadcast channels received over a hybrid tuner.
The broadcasting API describes the video/broadcast embedded object needed to support display and control by a DAE application of scheduled content received over local tuner functionality available to an OITF, including the conveyance of the channel list to the server. The term “tuner” is used here to identify a piece of functionality to enable switching between different types of scheduled content services that are identified through logical channels. This includes IP broadcast channels, as well as traditionalbroadcast channels received over a hybrid tuner.
Line 19: Line 19:
[[Image(Impl.png)]]
[[Image(Impl.png)]]
-
=== 1.1 <video/broadcast> Embeded Object ===
+
=== 1.1 <video/broadcast> Embedded Object ===
-
MIME Type: "video/broadcast" [[BR]]
+
MIME Type: "video/broadcast"  
-
|| '''<video/broadcast> Object''' ||
+
 
-
|| Name || Type || Notes ||
+
{|
-
|| width || Property Integer || ||
+
| '''<video/broadcast> Object''' ||
-
|| height || Property Integer || ||
+
|+
-
|| fullscreen || Property Integer || ||
+
| Name || Type || Notes ||
-
|| playState || Property Integer || ||
+
|+
-
|| currentChannel || Property Channel || ||
+
| width || Property Integer || ||
-
|| ChannelChangeError || Event (Channel channel, Number errorState) || ||
+
|+
-
|| PlayStateChange || Event (Number state, Number error) || ||
+
| height || Property Integer || ||
-
|| ChannenChangeSucceeded || Event (Channel channel) || ||
+
|+
-
|| FullscreenChange || Event () || ||
+
| fullscreen || Property Integer || ||
-
|| getChannelConfig || Method ChannelConfig () || ||
+
|+
-
|| bindToCurrentChannel || Method Channel (Channel) || ||
+
| playState || Property Integer || ||
-
|| createChannelObject || Method Channel (Integer idType, String dsd, Integer id)|| ||
+
|+
-
|| setChannel || Method void (Channel channel, Boolean trickplay, String contentAccessDescriptorURL) || ||
+
| currentChannel || Property Channel || ||
-
|| prevChannel || Method void () || ||
+
|+
-
|| nextChannel || Method void () || ||
+
| ChannelChangeError || Event (Channel channel, Number errorState) || ||
-
|| stop || Method void () || ||
+
|+
-
|| setVolume || Method Boolean (Integer volume) || ||
+
| PlayStateChange || Event (Number state, Number error) || ||
-
|| getVolume || Method Integer () || ||
+
|+
-
|| release || Method void () || ||
+
| ChannenChangeSucceeded || Event (Channel channel) || ||
 +
|+
 +
| FullscreenChange || Event () || ||
 +
|+
 +
| getChannelConfig || Method ChannelConfig () || ||
 +
|+
 +
| bindToCurrentChannel || Method Channel (Channel) || ||
 +
|+
 +
| createChannelObject || Method Channel (Integer idType, String dsd, Integer id)|| ||
 +
|+
 +
| setChannel || Method void (Channel channel, Boolean trickplay, String contentAccessDescriptorURL) || ||
 +
|+
 +
| prevChannel || Method void () || ||
 +
|+
 +
| nextChannel || Method void () || ||
 +
|+
 +
| stop || Method void () || ||
 +
|+
 +
| setVolume || Method Boolean (Integer volume) || ||
 +
|+
 +
| getVolume || Method Integer () || ||
 +
|+
 +
| release || Method void () || ||
 +
|}
=== 1.2 ChannelConfig Class ===
=== 1.2 ChannelConfig Class ===
-
The ChannelConfig object provides the entry point for applications to get information about available channels [[BR]]
+
The ChannelConfig object provides the entry point for applications to get information about available channels
-
|| '''ChannelList class''' || || ||
+
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
-
|| channelList || Property ChannelList || the list of all available channels ||
+
-
|| ChannelScan || Event (Integer type, Integer progress, Integer frequency,Integer signalStrength, Integer channelNumber, Integer channelType, Integer channelCount,Integer transponderCount) || ||
+
-
|| ChannelListUpdate || Event (void) || ||
+
-
|| startScan || Method Integer (ChannelScanOptions options, ChannelScanParameters scanParameters) || ||
+
-
|| stopScan || Method void () || ||
+
 +
{|
 +
| '''ChannelList class''' || || ||
 +
|+
 +
| '''Name''' || '''Type''' || '''Notes''' ||
 +
|+
 +
| channelList || Property ChannelList || the list of all available channels ||
 +
|+
 +
| ChannelScan || Event (Integer type, Integer progress, Integer frequency,Integer signalStrength, Integer channelNumber, Integer channelType, Integer channelCount,Integer transponderCount) || ||
 +
|+
 +
| ChannelListUpdate || Event (void) || ||
 +
|+
 +
| startScan || Method Integer (ChannelScanOptions options, ChannelScanParameters scanParameters) || ||
 +
|+
 +
| stopScan || Method void () || ||
 +
|}
=== 1.3 ChannelList Class ===
=== 1.3 ChannelList Class ===
-
|| '''ChannelList class''' || || ||
+
{|
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
| '''ChannelList class''' || || ||
-
|| getChannel || Method Channel (String channelID) || ||
+
|+
-
|| getChannelByTriplet || Method Channel (Integer onid, Integer tsid, Integer sid) || ||
+
| '''Name''' || '''Type''' || '''Notes''' ||
-
|| getChannelBySourceID || Method Channel (Integer sourceID) || ||
+
|+
-
 
+
| getChannel || Method Channel (String channelID) || ||
 +
|+
 +
| getChannelByTriplet || Method Channel (Integer onid, Integer tsid, Integer sid) || ||
 +
|+
 +
| getChannelBySourceID || Method Channel (Integer sourceID) || ||
 +
|}
=== 1.4 Channel Class ===
=== 1.4 Channel Class ===
-
|| ''' Channel class ''' || || ||
+
{|
-
|| '''Name''' || ''' Type ''' || '''Notes''' ||
+
| ''' Channel class ''' || || ||
-
|| channelType || Property Integer || ||
+
|+
-
|| idType || Property Integer || ||
+
| '''Name''' || ''' Type ''' || '''Notes''' ||
-
|| ccid || Property String || ||
+
|+
-
|| tunerID || Property String || optional ||
+
| channelType || Property Integer || ||
-
|| onid || Property Integer || DVB or ISDB original network ID ||
+
|+
-
|| tsid || Property Integer || DVB or ISDB transport stream ID (for channels of type ID_DVB_* and ID_ISDB_*) ||
+
| idType || Property Integer || ||
-
|| sid || Property Integer || DVB or ISDB service ID (for channels of type ID_DVB_* and ID_ISDB_*) ||
+
|+
-
|| sourceID || Property Integer || ATSC source_ID value ||
+
| ccid || Property String || ||
-
|| freq || Property Integer || For analogue channels, the frequency of the video carrier in kHz ||
+
|+
-
|| cni || Property Integer || For analogue channels, the VPS/PDC confirmed network identifier ||
+
| tunerID || Property String || optional ||
-
|| name || Property String || The name of the channel. Can be used for linking analog channels without CNI ||
+
|+
-
|| majorChannel || Property Integer || The major channel number, if assigned. Value undefined otherwise. Typically used for channels of type ID_ATSC_*. ||
+
| onid || Property Integer || DVB or ISDB original network ID ||
-
|| minorChannel || Property Integer || The minor channel number, if assigned. Value undefined otherwise. Typically used for channels of type ID_ATSC_* ||
+
|+
-
|| dsd || Property String || this property defines the delivery system descriptor (tuning parameters) as defined by DVB-SI ||
+
| tsid || Property Integer || DVB or ISDB transport stream ID (for channels of type ID_DVB_* and ID_ISDB_*) ||
-
 
+
|+
 +
| sid || Property Integer || DVB or ISDB service ID (for channels of type ID_DVB_* and ID_ISDB_*) ||
 +
|+
 +
| sourceID || Property Integer || ATSC source_ID value ||
 +
|+
 +
| freq || Property Integer || For analogue channels, the frequency of the video carrier in kHz ||
 +
|+
 +
| cni || Property Integer || For analogue channels, the VPS/PDC confirmed network identifier ||
 +
|+
 +
| name || Property String || The name of the channel. Can be used for linking analog channels without CNI ||
 +
|+
 +
| majorChannel || Property Integer || The major channel number, if assigned. Value undefined otherwise. Typically used for channels of type ID_ATSC_*. ||
 +
|+
 +
| minorChannel || Property Integer || The minor channel number, if assigned. Value undefined otherwise. Typically used for channels of type ID_ATSC_* ||
 +
|+
 +
| dsd || Property String || this property defines the delivery system descriptor (tuning parameters) as defined by DVB-SI ||
 +
|}
=== 1.5 ChannelScanOptions class ===
=== 1.5 ChannelScanOptions class ===
-
|| ''' ChannelScanOptions ''' || || ||
+
{|
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
|+
-
|| channelType || Property Integer || The types of channel that should be discovered during the scan. Valid values are TYPE_TV(0), TYPE_RADIO(1), or TYPE_OTHER(2)||
+
| ''' ChannelScanOptions ''' || || ||
-
|| replaceExisting || Property Boolean || If true, any existing channels in the channel list managed by the OITF SHALL removed||
+
|+
 +
| '''Name''' || '''Type''' || '''Notes''' ||
 +
|+
 +
| channelType || Property Integer || The types of channel that should be discovered during the scan. Valid values are TYPE_TV(0), TYPE_RADIO(1), or TYPE_OTHER(2)||
 +
|+
 +
| replaceExisting || Property Boolean || If true, any existing channels in the channel list managed by the OITF SHALL removed||
 +
|}
 +
=== 1.6 ChannelScanParameters class ===
 +
ChannelScanParameters is base of other channel scan parameters type
-
=== 1.6 ChannelScanParameters class ===
 
-
ChannelScanParameters is base of other channel scan parameters type [[BR]]
 
* DVBTChannelScanParameters class
* DVBTChannelScanParameters class
-
|| ''' DVBTChannelScanParameters ''' || || ||
+
{|
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
|+
-
|| startFrequency || Property Integer || The start frequency of the scan, in kHz. ||
+
| ''' DVBTChannelScanParameters ''' || || ||
-
|| endFrequency || Property Integer || The start frequency of the scan, in kHz. ||
+
|+
-
|| ofdm|| Property String || The Orthogonal Frequency Division Multiplexing (OFDM) for the indicating frequency ||
+
| '''Name''' || '''Type''' || '''Notes''' ||
-
|| modulationModes || Property Integer || The modulation modes to be scanned. ||
+
|+
-
|| bandwidth || Property String || The expected bandwidth ||
+
| startFrequency || Property Integer || The start frequency of the scan, in kHz. ||
-
 
+
|+
 +
| endFrequency || Property Integer || The start frequency of the scan, in kHz. ||
 +
|+
 +
| ofdm|| Property String || The Orthogonal Frequency Division Multiplexing (OFDM) for the indicating frequency ||
 +
|+
 +
| modulationModes || Property Integer || The modulation modes to be scanned. ||
 +
|+
 +
| bandwidth || Property String || The expected bandwidth ||
 +
|}
=== 1.7 Sample Code ===
=== 1.7 Sample Code ===
-
{{{
+
<code>
-
1 <html>
+
1 <html>
-
2
+
2
-
3 <head>
+
3 <head>
-
4 <script>
+
4 <script>
-
5 function start_scan() {
+
5 function start_scan() {
-
6 var plugin = document.getElementById("broadcast_object");
+
6 var plugin = document.getElementById("broadcast_object");
-
7 var channelConfig = plugin.getChannelConfig();
+
7 var channelConfig = plugin.getChannelConfig();
-
8 channelConfig.addEventListener("onChannelScan", function (channel) {
+
8 channelConfig.addEventListener("onChannelScan", function (channel) {
-
9 // do your callback
+
9 // do your callback
-
10 });
+
10 });
-
11 channelConfig.startScan();
+
11 channelConfig.startScan();
-
12 }
+
12 }
-
13
+
13  
-
14 function stop_scan() {
+
14 function stop_scan() {
-
15 var plugin = document.getElementById("broadcast_object");
+
15 var plugin = document.getElementById("broadcast_object");
-
16 var channelConfig = plugin.getChannelConfig();
+
16 var channelConfig = plugin.getChannelConfig();
-
17 channelConfig.stopScan();
+
17 channelConfig.stopScan();
-
18 }
+
18 }
-
19
+
19  
-
20 function prevChannel() {
+
20 function prevChannel() {
-
21 var plugin = document.getElementById("broadcast_object");
+
21 var plugin = document.getElementById("broadcast_object");
-
22 var channelConfig = plugin.getChannelConfig();
+
22 var channelConfig = plugin.getChannelConfig();
-
23 channelConfig.prevChannel();
+
23 channelConfig.prevChannel();
-
24 }
+
24 }
-
25
+
25  
-
26 function nextChannel() {
+
26 function nextChannel() {
-
27 var plugin = document.getElementById("broadcast_object");
+
27 var plugin = document.getElementById("broadcast_object");
-
28 var channelConfig = plugin.getChannelConfig();
+
28 var channelConfig = plugin.getChannelConfig();
-
29 channelConfig.nextChannel();
+
29 channelConfig.nextChannel();
-
30 }
+
30 }
-
31
+
31  
-
32 </script>
+
32 </script>
-
33 </head>
+
33 </head>
-
34
+
34  
-
35 <body>
+
35 <body>
-
36
+
36  
-
37 <div id="pluginContainer">
+
37 <nowiki><div id="pluginContainer"></nowiki>
-
38 <object type="video/broadcast" width=600 height=400 id="broadcast_object">
+
38 <object type="video/broadcast" width=600 height=400 id="broadcast_object">
-
39 the broadcast video window
+
39 the broadcast video window
-
40 </object>
+
40 </object>
-
41
+
41  
-
42 <button onclick="start_scan()">Start Scan</button>
+
42 <button onclick="start_scan()">Start Scan</button>
-
43 <button onclick="stop_scan()">Stop Scan</button>
+
43 <button onclick="stop_scan()">Stop Scan</button>
-
44
+
44  
-
45 <button onclick="nextChanel()">Next Channel</button>
+
45 <button onclick="nextChanel()">Next Channel</button>
-
46 <button onclick="prevChanel()">Prev Channel</button>
+
46 <button onclick="prevChanel()">Prev Channel</button>
-
47 </div>
+
47 </div>
-
48 </body>
+
48 </body>
-
49
+
49  
-
50 </html>
+
50 </html>
-
}}}
+
</code>
== 2. Configuration and setting APIs ==
== 2. Configuration and setting APIs ==
-
* '''Reference''': Open IPTV DAE specfication Section 7.3[[BR]]
+
* '''Reference''': Open IPTV DAE specfication Section 7.3
-
* '''Status''': Under development[[BR]]
+
* '''Status''': Under development
=== 2.1 application/oipfConfiguration embed object ===
=== 2.1 application/oipfConfiguration embed object ===
MIME type: "application/oipfConfiguration"
MIME type: "application/oipfConfiguration"
-
|| '''<application/oipfConfiguration> Object''' ||
 
-
|| Name || Type || Notes ||
 
-
|| configuration || Property Configuration || ||
 
-
|| localSystem || Property LocalSystem || ||
 
 +
{|
 +
| '''<application/oipfConfiguration> Object''' ||
 +
|+
 +
| Name || Type || Notes ||
 +
|+
 +
| configuration || Property Configuration || ||
 +
|+
 +
| localSystem || Property LocalSystem || ||
 +
|}
=== 2.2 Configuration class ===
=== 2.2 Configuration class ===
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
{|
-
|| preferredAudioLanguage || Property String || ||
+
| '''Name''' || '''Type''' || '''Notes''' ||
-
|| preferredSubtitleLanguage || Property String || ||
+
|+
-
|| countryId || Property String || ||
+
| preferredAudioLanguage || Property String || ||
-
|| regionId || Property Integer|| ||
+
|+
-
|| pvrPolicy || Property Integer || ||
+
| preferredSubtitleLanguage || Property String || ||
-
|| pvrSaveEpisodes || Property Integer|| ||
+
|+
-
|| pvrSaveDays || Property Integer|| ||
+
| countryId || Property String || ||
-
|| pvrStartPadding || Property Integer|| ||
+
|+
-
|| pvrEndPadding || Property Integer|| ||
+
| regionId || Property Integer|| ||
-
|| preferredTimeShiftMode || Property Integer|| ||
+
|+
-
|| getText || Method String (String key) || ||
+
| pvrPolicy || Property Integer || ||
-
|| setText || Method void (String key, String value) ||
+
|+
-
 
+
| pvrSaveEpisodes || Property Integer|| ||
 +
|+
 +
| pvrSaveDays || Property Integer|| ||
 +
|+
 +
| pvrStartPadding || Property Integer|| ||
 +
|+
 +
| pvrEndPadding || Property Integer|| ||
 +
|+
 +
| preferredTimeShiftMode || Property Integer|| ||
 +
|+
 +
| getText || Method String (String key) || ||
 +
|+
 +
| setText || Method void (String key, String value) ||
 +
|}
=== 2.3 LocalSystem class ===
=== 2.3 LocalSystem class ===
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
{|
-
|| deviceID || Property String || ||
+
| '''Name''' || '''Type''' || '''Notes''' ||
-
|| systemReady || Property Boolean || ||
+
|+
-
|| vendorName || Property String || ||
+
| deviceID || Property String || ||
-
|| modelName || Property String || ||
+
|+
-
|| softwareVersion || Property String || ||
+
| systemReady || Property Boolean || ||
-
|| hardwareVersion || Property String || ||
+
|+
-
|| serialNumber || Property String || ||
+
| vendorName || Property String || ||
-
|| releaseVersion || Property Integer || ||
+
|+
-
|| majorVersion || Property Integer || ||
+
| modelName || Property String || ||
-
|| minorVersion|| Property Integer || ||
+
|+
-
|| oipfProfile|| Property String || ||
+
| softwareVersion || Property String || ||
-
|| pvrEnabled || Property Boolean || ||
+
|+
-
|| ciplusEnabled|| Property Boolean || ||
+
| hardwareVersion || Property String || ||
-
|| standbyState|| Property Boolean || ||
+
|+
-
|| powerState || Property Integer || ||
+
| serialNumber || Property String || ||
-
|| previousPowerState || Property Integer || ||
+
|+
-
|| timeCurrentPowerState || Property Integer || ||
+
| releaseVersion || Property Integer || ||
-
|| volume || Property Integer || ||
+
|+
-
|| mute || Property Boolean || ||
+
| majorVersion || Property Integer || ||
-
|| outputs || Property AVOutputCollection || ||
+
|+
-
|| networkInterfaces || Property NetworkInterfaceCollection || ||
+
| minorVersion|| Property Integer || ||
-
|| tuners || Property TunerCollection || ||
+
|+
-
|| tvStandard || Property Integer || ||
+
| oipfProfile|| Property String || ||
-
|| pvrSupport || Property Integer || ||
+
|+
-
|| setScreenSize || Method Boolean (Integer width, Integer height) || ||
+
| pvrEnabled || Property Boolean || ||
-
|| setPvrSupport || Method Integer(Integer state) || ||
+
|+
-
|| setPowerState || Method Boolean (Integer type) || ||
+
| ciplusEnabled|| Property Boolean || ||
-
|| setDigestCredentials || Method Boolean (String protocol, String domain, String username, String password) || ||
+
|+
-
|| clearDigestCredentials || Method Boolean (String protocol, String domain) || ||
+
| standbyState|| Property Boolean || ||
-
|| PowerStateChange || Event (Integer powerState) || ||
+
|+
 +
| powerState || Property Integer || ||
 +
|+
 +
| previousPowerState || Property Integer || ||
 +
|+
 +
| timeCurrentPowerState || Property Integer || ||
 +
|+
 +
| volume || Property Integer || ||
 +
|+
 +
| mute || Property Boolean || ||
 +
|+
 +
| outputs || Property AVOutputCollection || ||
 +
|+
 +
| networkInterfaces || Property NetworkInterfaceCollection || ||
 +
|+
 +
| tuners || Property TunerCollection || ||
 +
|+
 +
| tvStandard || Property Integer || ||
 +
|+
 +
| pvrSupport || Property Integer || ||
 +
|+
 +
| setScreenSize || Method Boolean (Integer width, Integer height) || ||
 +
|+
 +
| setPvrSupport || Method Integer(Integer state) || ||
 +
|+
 +
| setPowerState || Method Boolean (Integer type) || ||
 +
|+
 +
| setDigestCredentials || Method Boolean (String protocol, String domain, String username, String password) || ||
 +
|+
 +
| clearDigestCredentials || Method Boolean (String protocol, String domain) || ||
 +
|+
 +
| PowerStateChange || Event (Integer powerState) || ||
 +
|}
=== 2.4 NetworkInterface class ===
=== 2.4 NetworkInterface class ===
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
{|
-
|| ipAddress || Property String || ||
+
| '''Name''' || '''Type''' || '''Notes''' ||
-
|| macAddress || Property String || ||
+
|+
-
|| connected || Property Boolean || ||
+
| ipAddress || Property String || ||
-
|| enabled|| Property Boolean || ||
+
|+
-
 
+
| macAddress || Property String || ||
 +
|+
 +
| connected || Property Boolean || ||
 +
|+
 +
| enabled|| Property Boolean || ||
 +
|}
=== 2.4 AVOutput class ===
=== 2.4 AVOutput class ===
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
{|
-
|| name || Property String || ||
+
| '''Name''' || '''Type''' || '''Notes''' ||
-
|| type || Property String || ||
+
|+
-
|| enabled || Property Boolean || ||
+
| name || Property String || ||
-
|| subtitleEnabled || Property Boolean || ||
+
|+
-
|| videoMode || Property String || ||
+
| type || Property String || ||
-
|| digitalAudioMode || Property String || ||
+
|+
-
|| audioRange || Property String || ||
+
| enabled || Property Boolean || ||
-
|| hdVideoFormat || Property String || ||
+
|+
-
|| tvAspectRatio || Property String || ||
+
| subtitleEnabled || Property Boolean || ||
-
|| supportedVideoModes || Property String || ||
+
|+
-
|| supportedDigitalAudioModes || Property String || ||
+
| videoMode || Property String || ||
-
|| supportedAudioRanges|| Property String || ||
+
|+
-
 
+
| digitalAudioMode || Property String || ||
 +
|+
 +
| audioRange || Property String || ||
 +
|+
 +
| hdVideoFormat || Property String || ||
 +
|+
 +
| tvAspectRatio || Property String || ||
 +
|+
 +
| supportedVideoModes || Property String || ||
 +
|+
 +
| supportedDigitalAudioModes || Property String || ||
 +
|+
 +
| supportedAudioRanges|| Property String || ||
 +
|}
=== 2.5 Sample code ===
=== 2.5 Sample code ===
-
Sample code of using configuration APIs[[BR]]
+
Sample code of using configuration APIs
-
{{{
+
<code>
-
1 <html>
+
1 <html>
-
2 <head>
+
2 <head>
-
3 <script>
+
3 <script>
-
4 function start_scan() {
+
4 function start_scan() {
-
5 var plugin = document.getElementById("config_object");
+
5 var plugin = document.getElementById("config_object");
-
6
+
6  
-
7 var configuration = plugin.configuration;
+
7 var configuration = plugin.configuration;
-
8
+
8  
-
9 console.log(configuration.countryId);
+
9 console.log(configuration.countryId);
-
10
+
10  
-
11 var localSystem = plugin.localsystem;
+
11 var localSystem = plugin.localsystem;
-
12
+
12  
-
13 console.log(localSystem.deviceID);
+
13 console.log(localSystem.deviceID);
-
14 console.log(localSystem.vendorName);
+
14 console.log(localSystem.vendorName);
-
15 console.log(localSystem.softwareVersion);
+
15 console.log(localSystem.softwareVersion);
-
16 }
+
16 }
-
17 </script>
+
17 </script>
-
18 </head>
+
18 </head>
-
19
+
19  
-
20 <body>
+
20 <body>
-
21 <div id="pluginContainer">
+
21<nowiki> <div id="pluginContainer"></nowiki>
-
22 <object type="application/oipfConfiguration" id="config_object" visible=false>
+
22 <object type="application/oipfConfiguration" id="config_object" visible=false>
-
23 The system configuration object
+
23 The system configuration object
-
24 </object>
+
24 </object>
-
25
+
25  
-
26 <button onclick="get_config()">Get Configuration</button>
+
26 <button onclick="get_config()">Get Configuration</button>
-
27 </div>
+
27 <nowiki></div></nowiki>
-
28 </body>
+
28 </body>
-
29
+
29  
-
30 </html>
+
30 </html>
-
}}}
+
</code>
== 3. Media Playback APIs ==
== 3. Media Playback APIs ==
-
* '''Reference''': Open IPTV DAE specfication Section 7.14[[BR]]
+
* '''Reference''': Open IPTV DAE specfication Section 7.14
-
* '''Status''': Already ready in MeeGo 1.2, need some effot to port to Tizen [[BR]]
+
* '''Status''': Already ready in MeeGo 1.2, need some effot to port to Tizen
=== 3.1 A/V control embed object ===
=== 3.1 A/V control embed object ===
-
|| '''Name''' || '''Type''' || '''Notes''' ||
+
{|
-
|| speed || Property Integer || ||
+
| '''Name''' || '''Type''' || '''Notes''' ||
-
|| playPosition || Property Integer || ||
+
|+
-
|| playState || Property Integer || ||
+
| speed || Property Integer || ||
-
|| setSource || Method Boolean (String uri) || ||
+
|+
-
|| play || Method void (void ) || ||
+
| playPosition || Property Integer || ||
-
|| pause || Method void (void) || ||
+
|+
-
|| stop || Method void (void ) || ||
+
| playState || Property Integer || ||
-
|| seek || Method void (Integer) || ||
+
|+
-
|| setVolume || Method void (Integer) || ||
+
| setSource || Method Boolean (String uri) || ||
-
|| getVolume || Method Integer (void) || ||
+
|+
-
|| PlayerStateChanged || Event Integer || ||
+
| play || Method void (void ) || ||
-
|| PlayPositionChanged || Event Integer || ||
+
|+
-
 
+
| pause || Method void (void) || ||
 +
|+
 +
| stop || Method void (void ) || ||
 +
|+
 +
| seek || Method void (Integer) || ||
 +
|+
 +
| setVolume || Method void (Integer) || ||
 +
|+
 +
| getVolume || Method Integer (void) || ||
 +
|+
 +
| PlayerStateChanged || Event Integer || ||
 +
|+
 +
| PlayPositionChanged || Event Integer || ||
 +
|}
=== 3.2 Sample Code ===
=== 3.2 Sample Code ===
-
{{{
+
Sample code of using media APIs
-
1 <html>
+
<code>
-
2 <head>
+
1 <html>
-
3 <script>
+
2 <head>
-
4 function play_function() {
+
3 <script>
-
5 var plugin = document.getElementById("plugin_id");
+
4 function play_function() {
-
6 plugin.play();
+
5 var plugin = document.getElementById("plugin_id");
-
7 }
+
6 plugin.play();
-
8
+
7 }
-
9 function set_uri() {
+
8  
-
10 var plugin = document.getElementById("plugin_id");
+
9 function set_uri() {
-
11 plugin.setSource("file:///home/meego/Videos/sintel_trailer-240p.ogv");
+
10 var plugin = document.getElementById("plugin_id");
-
12 }
+
11 plugin.setSource("file:///home/meego/Videos/sintel_trailer-240p.ogv");
-
13
+
12 }
-
14
+
13  
-
15 function stop_function() {
+
14  
-
16 var plugin = document.getElementById("plugin_id");
+
15 function stop_function() {
-
17 plugin.stop();
+
16 var plugin = document.getElementById("plugin_id");
-
18 }
+
17 plugin.stop();
-
19
+
18 }
-
20 function pause_function() {
+
19  
-
21 var plugin = document.getElementById("plugin_id");
+
20 function pause_function() {
-
22 plugin.pause();
+
21 var plugin = document.getElementById("plugin_id");
-
23 }
+
22 plugin.pause();
-
24
+
23 }
-
25 function player_state_changed(state) {
+
24  
-
26 console.log("player state changed");
+
25 function player_state_changed(state) {
-
27 document.getElementById("state").innerHTML = "<b>State: " + state + "</b>";
+
26 console.log("player state changed");
-
28 }
+
27 document.getElementById("state").innerHTML = "<b>State: " + state + "</b>";
-
29
+
28 }
-
30 function onload_function() {
+
29  
-
31 document.getElementById("page").innerHTML = "Loaded";
+
30 function onload_function() {
-
32 document.getElementById("plugin_id").addEventListener("PlayStateChanged", player_state_changed ,false );
+
31 document.getElementById("page").innerHTML = "Loaded";
-
33 }
+
32 document.getElementById("plugin_id").addEventListener("PlayStateChanged", player_state_changed ,false );
-
34 </script>
+
33 }
-
35 </head>
+
34 </script>
-
36
+
35 </head>
-
37 <body onload="onload_function()" >
+
36  
-
38 <embed type="application/x-oipf" width=600 height=400 id="plugin_id">
+
37 <body onload="onload_function()" >
-
39 media playback window
+
38 <embed type="application/x-oipf" width=600 height=400 id="plugin_id">
-
40 </embed>
+
39 media playback window
-
41 <button onclick="set_uri()">SetUri</button>
+
40 </embed>
-
42 <button onclick="play_function()">play</button>
+
41 <button onclick="set_uri()">SetUri</button>
-
43 <button onclick="stop_function()">stop</button>
+
42 <button onclick="play_function()">play</button>
-
44 <button onclick="pause_function()">pause</button>
+
43 <button onclick="stop_function()">stop</button>
-
45
+
44 <button onclick="pause_function()">pause</button>
-
46 <div id="state"><b>State</b></div>
+
45  
-
47 </body>
+
46 <nowiki><div id="state"><b>State</b></div></nowiki>
-
48 </html>
+
47 </body>
 +
48 </html>
 +
</code>

Revision as of 18:37, 26 January 2012

Contents

Tizen TV Browser Web API

The Tizen TV Web API refers and follows to the Open IPTV DAE ( Declarative Application Environment V2.1 ) specification

Table of Contents

  • [wiki:Tizen_TV_Browser/Web_API#a1.TunerandBroadcastingAPI Tuner and Broadcasting API ]
  • [wiki:Tizen_TV_Browser/Web_API#a2.ConfigurationandsettingAPIs Configuration and setting API]
  • [wiki:Tizen_TV_Browser/Web_API#a3.MediaPlaybackAPIs Media Playback API]

1. Tuner and Broadcasting API

  • Reference: Open IPTV DAE specfication Section 7.13
  • Status: Under development
  • Overview:

The broadcasting API describes the video/broadcast embedded object needed to support display and control by a DAE application of scheduled content received over local tuner functionality available to an OITF, including the conveyance of the channel list to the server. The term “tuner” is used here to identify a piece of functionality to enable switching between different types of scheduled content services that are identified through logical channels. This includes IP broadcast channels, as well as traditionalbroadcast channels received over a hybrid tuner.

Image(Channel.jpg)

  • Implementation

The implementation is based on NPAPI. And the channel scan uses w-scan as the low-level scan library, the w-scan is wrapped into D-Bus service. The playback is based on UMMS, which is also D-Bus service.

Image(Impl.png)

1.1 <video/broadcast> Embedded Object

MIME Type: "video/broadcast"

<video/broadcast> Object
Name Type Notes
width Property Integer
height Property Integer
fullscreen Property Integer
playState Property Integer
currentChannel Property Channel
ChannelChangeError Event (Channel channel, Number errorState)
PlayStateChange Event (Number state, Number error)
ChannenChangeSucceeded Event (Channel channel)
FullscreenChange Event ()
getChannelConfig Method ChannelConfig ()
bindToCurrentChannel Method Channel (Channel)
createChannelObject Method Channel (Integer idType, String dsd, Integer id)
setChannel Method void (Channel channel, Boolean trickplay, String contentAccessDescriptorURL)
prevChannel Method void ()
nextChannel Method void ()
stop Method void ()
setVolume Method Boolean (Integer volume)
getVolume Method Integer ()
release Method void ()

1.2 ChannelConfig Class

The ChannelConfig object provides the entry point for applications to get information about available channels

ChannelList class
Name Type Notes
channelList Property ChannelList the list of all available channels
ChannelScan Event (Integer type, Integer progress, Integer frequency,Integer signalStrength, Integer channelNumber, Integer channelType, Integer channelCount,Integer transponderCount)
ChannelListUpdate Event (void)
startScan Method Integer (ChannelScanOptions options, ChannelScanParameters scanParameters)
stopScan Method void ()

1.3 ChannelList Class

ChannelList class
Name Type Notes
getChannel Method Channel (String channelID)
getChannelByTriplet Method Channel (Integer onid, Integer tsid, Integer sid)
getChannelBySourceID Method Channel (Integer sourceID)

1.4 Channel Class

Channel class
Name Type Notes
channelType Property Integer
idType Property Integer
ccid Property String
tunerID Property String optional
onid Property Integer DVB or ISDB original network ID
tsid Property Integer DVB or ISDB transport stream ID (for channels of type ID_DVB_* and ID_ISDB_*)
sid Property Integer DVB or ISDB service ID (for channels of type ID_DVB_* and ID_ISDB_*)
sourceID Property Integer ATSC source_ID value
freq Property Integer For analogue channels, the frequency of the video carrier in kHz
cni Property Integer For analogue channels, the VPS/PDC confirmed network identifier
name Property String The name of the channel. Can be used for linking analog channels without CNI
majorChannel Property Integer The major channel number, if assigned. Value undefined otherwise. Typically used for channels of type ID_ATSC_*.
minorChannel Property Integer The minor channel number, if assigned. Value undefined otherwise. Typically used for channels of type ID_ATSC_*
dsd Property String this property defines the delivery system descriptor (tuning parameters) as defined by DVB-SI

1.5 ChannelScanOptions class

ChannelScanOptions
Name Type Notes
channelType Property Integer The types of channel that should be discovered during the scan. Valid values are TYPE_TV(0), TYPE_RADIO(1), or TYPE_OTHER(2)
replaceExisting Property Boolean If true, any existing channels in the channel list managed by the OITF SHALL removed

1.6 ChannelScanParameters class

ChannelScanParameters is base of other channel scan parameters type

  • DVBTChannelScanParameters class
DVBTChannelScanParameters
Name Type Notes
startFrequency Property Integer The start frequency of the scan, in kHz.
endFrequency Property Integer The start frequency of the scan, in kHz.
ofdm Property String The Orthogonal Frequency Division Multiplexing (OFDM) for the indicating frequency
modulationModes Property Integer The modulation modes to be scanned.
bandwidth Property String The expected bandwidth

1.7 Sample Code

1 <html>
2
3 <head>
4 <script>
5 function start_scan() {
6 var plugin = document.getElementById("broadcast_object");
7 var channelConfig = plugin.getChannelConfig();
8 channelConfig.addEventListener("onChannelScan", function (channel) {
9 // do your callback
10 });
11 channelConfig.startScan();
12 }
13 
14 function stop_scan() {
15 var plugin = document.getElementById("broadcast_object");
16 var channelConfig = plugin.getChannelConfig();
17 channelConfig.stopScan();
18 }
19 
20 function prevChannel() {
21 var plugin = document.getElementById("broadcast_object");
22 var channelConfig = plugin.getChannelConfig();
23 channelConfig.prevChannel();
24 }
25 
26 function nextChannel() {
27 var plugin = document.getElementById("broadcast_object");
28 var channelConfig = plugin.getChannelConfig();
29 channelConfig.nextChannel();
30 }
31 
32 </script>
33 </head>
34 
35 <body>
36 
37 <div id="pluginContainer">
38 <object type="video/broadcast" width=600 height=400 id="broadcast_object">
39 the broadcast video window
40 </object>
41 
42 <button onclick="start_scan()">Start Scan</button>
43 <button onclick="stop_scan()">Stop Scan</button>
44 
45 <button onclick="nextChanel()">Next Channel</button>
46 <button onclick="prevChanel()">Prev Channel</button>
47 </div>
48 </body>
49 
50 </html>


2. Configuration and setting APIs

  • Reference: Open IPTV DAE specfication Section 7.3
  • Status: Under development

2.1 application/oipfConfiguration embed object

MIME type: "application/oipfConfiguration"

<application/oipfConfiguration> Object
Name Type Notes
configuration Property Configuration
localSystem Property LocalSystem

2.2 Configuration class

Name Type Notes
preferredAudioLanguage Property String
preferredSubtitleLanguage Property String
countryId Property String
regionId Property Integer
pvrPolicy Property Integer
pvrSaveEpisodes Property Integer
pvrSaveDays Property Integer
pvrStartPadding Property Integer
pvrEndPadding Property Integer
preferredTimeShiftMode Property Integer
getText Method String (String key)
setText Method void (String key, String value)

2.3 LocalSystem class

Name Type Notes
deviceID Property String
systemReady Property Boolean
vendorName Property String
modelName Property String
softwareVersion Property String
hardwareVersion Property String
serialNumber Property String
releaseVersion Property Integer
majorVersion Property Integer
minorVersion Property Integer
oipfProfile Property String
pvrEnabled Property Boolean
ciplusEnabled Property Boolean
standbyState Property Boolean
powerState Property Integer
previousPowerState Property Integer
timeCurrentPowerState Property Integer
volume Property Integer
mute Property Boolean
outputs Property AVOutputCollection
networkInterfaces Property NetworkInterfaceCollection
tuners Property TunerCollection
tvStandard Property Integer
pvrSupport Property Integer
setScreenSize Method Boolean (Integer width, Integer height)
setPvrSupport Method Integer(Integer state)
setPowerState Method Boolean (Integer type)
setDigestCredentials Method Boolean (String protocol, String domain, String username, String password)
clearDigestCredentials Method Boolean (String protocol, String domain)
PowerStateChange Event (Integer powerState)

2.4 NetworkInterface class

Name Type Notes
ipAddress Property String
macAddress Property String
connected Property Boolean
enabled Property Boolean

2.4 AVOutput class

Name Type Notes
name Property String
type Property String
enabled Property Boolean
subtitleEnabled Property Boolean
videoMode Property String
digitalAudioMode Property String
audioRange Property String
hdVideoFormat Property String
tvAspectRatio Property String
supportedVideoModes Property String
supportedDigitalAudioModes Property String
supportedAudioRanges Property String

2.5 Sample code

Sample code of using configuration APIs

1 <html>
2 <head>
3 <script>
4 function start_scan() {
5 var plugin = document.getElementById("config_object");
6 
7 var configuration = plugin.configuration;
8 
9 console.log(configuration.countryId);
10 
11 var localSystem = plugin.localsystem;
12 
13 console.log(localSystem.deviceID);
14 console.log(localSystem.vendorName);
15 console.log(localSystem.softwareVersion);
16 }
17 </script>
18 </head>
19 
20 <body>
21 <div id="pluginContainer">
22 <object type="application/oipfConfiguration" id="config_object" visible=false>
23 The system configuration object
24 </object>
25 
26 <button onclick="get_config()">Get Configuration</button>
27 </div>
28 </body>
29 
30 </html>


3. Media Playback APIs

  • Reference: Open IPTV DAE specfication Section 7.14
  • Status: Already ready in MeeGo 1.2, need some effot to port to Tizen

3.1 A/V control embed object

Name Type Notes
speed Property Integer
playPosition Property Integer
playState Property Integer
setSource Method Boolean (String uri)
play Method void (void )
pause Method void (void)
stop Method void (void )
seek Method void (Integer)
setVolume Method void (Integer)
getVolume Method Integer (void)
PlayerStateChanged Event Integer
PlayPositionChanged Event Integer

3.2 Sample Code

Sample code of using media APIs

1 <html>
2 <head>
3 <script>
4 function play_function() {
5 var plugin = document.getElementById("plugin_id");
6 plugin.play();
7 }
8 
9 function set_uri() {
10 var plugin = document.getElementById("plugin_id");
11 plugin.setSource("file:///home/meego/Videos/sintel_trailer-240p.ogv");
12 }
13 
14 
15 function stop_function() {
16 var plugin = document.getElementById("plugin_id");
17 plugin.stop();
18 }
19 
20 function pause_function() {
21 var plugin = document.getElementById("plugin_id");
22 plugin.pause();
23 }
24 
25 function player_state_changed(state) {
26 console.log("player state changed");
27 document.getElementById("state").innerHTML = "State: " + state + "";
28 }
29 
30 function onload_function() {
31 document.getElementById("page").innerHTML = "Loaded";
32 document.getElementById("plugin_id").addEventListener("PlayStateChanged", player_state_changed ,false );
33 }
34 </script>
35 </head>
36 
37 <body onload="onload_function()" >
38 <embed type="application/x-oipf" width=600 height=400 id="plugin_id">
39 media playback window
40 </embed>
41 <button onclick="set_uri()">SetUri</button>
42 <button onclick="play_function()">play</button>
43 <button onclick="stop_function()">stop</button>
44 <button onclick="pause_function()">pause</button>
45 
46 <div id="state"><b>State</b></div>
47 </body>
48 </html>

Personal tools