Difference between revisions of "Tizen Player"
Line 267: | Line 267: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
+ | |||
+ | == Example == | ||
+ | === Screenshot === | ||
+ | [[File:tizen_player.png|thumb|640px|none|Example Screenshot (Tizen Player)]] | ||
+ | |||
+ | === Code === | ||
+ | <syntaxhighlight lang="json"> | ||
+ | { | ||
+ | "type": "pages", | ||
+ | "headline": "Tizen Player Test", | ||
+ | "template": { | ||
+ | "type": "separate", | ||
+ | "layout": "0,0,2,4", | ||
+ | "icon": "msx-white-soft:extension", | ||
+ | "color": "msx-glass", | ||
+ | "playerLabel": "Sintel © copyright Blender Foundation | durian.blender.org", | ||
+ | "action": "video:plugin:http://msx.benzac.de/plugins/html5x.html?url=http://msx.benzac.de/media/sintel/sintel.mp4", | ||
+ | "properties": { | ||
+ | "resume:position": "102", | ||
+ | "button:content:icon": "{context:contentIcon}", | ||
+ | "button:content:action": "{context:contentAction}", | ||
+ | "html5x:subtitle:en:English": "http://msx.benzac.de/media/sintel/en.vtt", | ||
+ | "html5x:subtitle:de:Deutsch": "http://msx.benzac.de/media/sintel/de.vtt", | ||
+ | "html5x:subtitle:es:Español": "http://msx.benzac.de/media/sintel/es.vtt", | ||
+ | "html5x:subtitle:fr:Français": "http://msx.benzac.de/media/sintel/fr.vtt", | ||
+ | "html5x:subtitle:it:Italiano": "http://msx.benzac.de/media/sintel/it.vtt", | ||
+ | "html5x:subtitle:nl:Nederlands": "http://msx.benzac.de/media/sintel/nl.vtt", | ||
+ | "html5x:subtitle:pl:Język polski": "http://msx.benzac.de/media/sintel/pl.vtt", | ||
+ | "html5x:subtitle:pt:Português": "http://msx.benzac.de/media/sintel/pt.vtt", | ||
+ | "html5x:subtitle:ru:Pусский": "http://msx.benzac.de/media/sintel/ru.vtt" | ||
+ | } | ||
+ | }, | ||
+ | "items": [{ | ||
+ | "title": "Sintel 1", | ||
+ | "titleFooter": "Audio & Subtitles", | ||
+ | "contentIcon": "settings", | ||
+ | "contentAction": "panel:request:player:options" | ||
+ | }, { | ||
+ | "title": "Sintel 2", | ||
+ | "titleFooter": "Audio only", | ||
+ | "contentIcon": "audiotrack", | ||
+ | "contentAction": "panel:request:player:audiotrack" | ||
+ | }, { | ||
+ | "title": "Sintel 3", | ||
+ | "titleFooter": "Subtitles only", | ||
+ | "contentIcon": "subtitles", | ||
+ | "contentAction": "panel:request:player:subtitle" | ||
+ | }] | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === Demo === | ||
+ | * Launch via App: http://msx.benzac.de/?start=content:http://msx.benzac.de/info/xp/data/tizen_test.json | ||
+ | * Launch via Demo Page: http://msx.benzac.de/info/?start=content:http://msx.benzac.de/info/xp/data/tizen_test.json | ||
+ | |||
+ | '''Note: This demo only works properly on a Samsung TV (2016+ models) with Media Station X 0.1.128 or higher.''' |
Revision as of 14:32, 15 February 2021
The Tizen player is used in Media Station X version 0.1.128 or higher for all Samsung TVs (2016+ models). In previous versions, the HTML5 player is used. The Tizen player works similar to the HTML5 player, but supports more video formats (e.g. 4k/8k formats) and can be configured via the Extended Properties of a content item to setup display, buffer, and/or stream settings. Additionally, you can interact with it using the player:commit
actions to get the current stream information and/or to select a specific audio/text track. Please see #Runtime Usage for more information. Some extended properties are dynamic and can also be set via an action at runtime.
Most of the extended properties are directly mapped to a corresponding Tizen (i.e. AVPlay
API) function. For more information, please visit: https://developer.samsung.com/smarttv/develop/api-references/samsung-product-api-references/avplay-api.html
Note: All properties are reset if a new video/audio is played. Please also note that you can still use the HTML5 player with a plugin (see Video/Audio Plugin#Examples)
Syntax[edit]
Property | Value | Example | Tizen Function | Dynamic | Since Version | Description |
---|---|---|---|---|---|---|
tizen:buffer:size |
{SECONDS} |
"tizen:buffer:size": "10" |
setBufferingParam("PLAYER_BUFFER_FOR_PLAY", "PLAYER_BUFFER_SIZE_IN_SECOND", {SECONDS}); setBufferingParam("PLAYER_BUFFER_FOR_RESUME", "PLAYER_BUFFER_SIZE_IN_SECOND", {SECONDS}); |
No | 0.1.128 | Sets up the initial and resume buffer size in seconds. The default buffer size is "10" . Please see AVPlay API for possible values.
|
tizen:buffer:size:init |
{SECONDS} |
"tizen:buffer:size:init": "10" |
setBufferingParam("PLAYER_BUFFER_FOR_PLAY", "PLAYER_BUFFER_SIZE_IN_SECOND", {SECONDS}); |
No | 0.1.128 | Sets up the initial buffer size in seconds. The default buffer size is "10" . Please see AVPlay API for possible values.
|
tizen:buffer:size:resume |
{SECONDS} |
"tizen:buffer:size:resume": "10" |
setBufferingParam("PLAYER_BUFFER_FOR_RESUME", "PLAYER_BUFFER_SIZE_IN_SECOND", {SECONDS}); |
No | 0.1.128 | Sets up the resume buffer size in seconds. The default buffer size is "10" . Please see AVPlay API for possible values.
|
tizen:buffer:timeout |
{SECONDS} |
"tizen:buffer:timeout": "20" |
setTimeoutForBuffering({SECONDS}); |
Yes | 0.1.128 | Sets up the buffer timeout in seconds. The default buffer timeout is "20" . Please see AVPlay API for possible values.
|
tizen:display:area |
{REL_X},{REL_Y},{REL_W},{REL_H} |
"tizen:display:area": "0,0,1,1" "tizen:display:area": "0.125,0,0.75,1" "tizen:display:area": "0,0.119,1,0.762" |
setDisplayRect({ABS_X}, {ABS_Y}, {ABS_W}, {ABS_H}); |
Yes | 0.1.128 | Sets up the display area with relative coordinates. The default area is "0,0,1,1" , which fills the entire screen. Please see AVPlay API for possible values.
Note: If this property is set, the property |
tizen:display:mode |
{DISPLAY_MODE} |
"tizen:display:mode": "PLAYER_DISPLAY_MODE_LETTER_BOX" "tizen:display:mode": "PLAYER_DISPLAY_MODE_FULL_SCREEN" "tizen:display:mode": "PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO" |
setDisplayMethod({DISPLAY_MODE}); |
Yes | 0.1.128 | Sets up the display mode. The default mode is "PLAYER_DISPLAY_MODE_LETTER_BOX" , which fills the entire screen (by keeping the video aspect ratio). Please see AVPlay API for possible values.
Note: If this property is set, the property |
tizen:load |
{ACTION} |
"tizen:load": "info:Tizen player loaded." |
n/a | No | 0.1.128 | Sets up an action that is executed if the player is loaded (i.e. the internal state is "IDLE" ). Please see AVPlay API for more information.
|
tizen:ready |
{ACTION} |
"tizen:ready": "info:Tizen player ready." |
n/a | Yes | 0.1.128 | Sets up an action that is executed if the player is ready (i.e. the internal state is "READY" ). Please see AVPlay API for more information.
|
tizen:start |
{ACTION} |
"tizen:start": "info:Tizen player started." |
n/a | Yes | 0.1.128 | Sets up an action that is executed if the player is started (i.e. the internal state is "PLAYING" or "PAUSED" ). Please see AVPlay API for more information.
|
tizen:stream:{STREAM_TYPE} |
{STREAM_VALUE} |
"tizen:stream:PREBUFFER_MODE": "5000" "tizen:stream:ADAPTIVE_INFO": "FIXED_MAX_RESOLUTION=7680X4320" "tizen:stream:ADAPTIVE_INFO": "BITRATES=5000~10000|STARTBITRATE=HIGHEST|SKIPBITRATE=LOWEST" |
setStreamingProperty({STREAM_TYPE}, {STREAM_VALUE}); |
No | 0.1.128 | Sets up a stream specific property. Please see AVPlay API for possible values.
|
tizen:track:audio |
{TRACK_INDEX} |
"tizen:track:audio": "1" |
setSelectTrack("AUDIO", {TRACK_INDEX}); |
Yes | 0.1.128 | Selects an audio track by indicating the index. Please see AVPlay API for more information.
|
tizen:track:text |
{TRACK_INDEX} |
"tizen:track:text": "1" |
setSelectTrack("TEXT", {TRACK_INDEX}); |
Yes | 0.1.128 | Selects a text track by indicating the index. Please see AVPlay API for more information.
|
Runtime Usage[edit]
It is possible to request data from the Tizen player (e.g. from an interaction plugin) and/or to set some extended properties via an action at runtime.
Actions[edit]
Syntax & Example | Data | Tizen Function | Since Version | Description |
---|---|---|---|---|
|
n/a | n/a | 0.1.128 | Sets up an extended property during runtime.
Note: Only the dynamic properties can be set at runtime. Please see #Syntax for more information. |
player:commit |
{
"key": "{PROPERTY}",
"value": "{VALUE}",
"action": "{ACTION}",
"data": null
}
|
n/a | 0.1.128 | Sets up an extended property during runtime and optionally executes an action on completion.
Note: Only the dynamic properties can be set at runtime. Please see #Syntax for more information. |
|
n/a |
|
0.1.128 | Requests info data from the player and commits the response to an interaction plugin. Please see AVPlay API for more information. For the response data structure, please see #Response Examples.
|
|
n/a | getStreamingProperty({STREAM_TYPE});
|
0.1.128 | Requests a stream specific property from the player and commits the response to an interaction plugin. Please see AVPlay API for more information. For the response data structure, please see #Response Examples.
|
|
n/a | getStreamingProperty({STREAM_TYPE});
|
0.1.128 | Requests multiple stream specific properties from the player and commits the response to an interaction plugin. Please see AVPlay API for more information. For the response data structure, please see #Response Examples.
|
Response Examples[edit]
Note: Please note that no action-related data
property is used for all response examples. Therefore, the committed data
property is always null
.
Action Example | Response Example |
---|---|
|
{
"response": {
"tizen": {
"info": {
"version": "1.0",
"state": "PLAYING",
"display": {
"area": "0,0,1,1",
"mode": "PLAYER_DISPLAY_MODE_LETTER_BOX"
},
"buffer": {
"timeout": 20,
"size": {
"init": 10,
"resume": 10
}
},
"stream": {
"video": {
"index": 0,
"info": {
"fourCC": "H264",
"Width": 1920,
"Height": 1080,
"Bit_rate": 477000
}
},
"audio": {
"index": 1,
"info": {
"language": "eng",
"channels": 2,
"sample_rate": 44100,
"bit_rate": 96000,
"fourCC": "AACL"
}
},
"text": {
"index": 2,
"info": {
"track_num": 0,
"track_lang": "eng",
"subtitle_type": -1,
"fourCC": "TTML"
}
}
},
"tracks": {
"video": [{
"index": 0,
"info": {
"fourCC": "H264",
"Width": 1920,
"Height": 1080,
"Bit_rate": 477000
}
}],
"audio": [{
"index": 1,
"info": {
"language": "eng",
"channels": 2,
"sample_rate": 44100,
"bit_rate": 96000,
"fourCC": "AACL"
}
}],
"text": [{
"index": 2,
"info": {
"track_num": 0,
"track_lang": "eng",
"subtitle_type": -1,
"fourCC": "TTML"
}
}]
}
}
}
},
"error": null,
"data": null
}
|
|
{
"response": {
"tizen": {
"property": {
"type": "IS_LIVE",
"value": "0"
}
}
},
"error": null,
"data": null
}
|
|
{
"response": {
"tizen": {
"properties": [{
"type": "IS_LIVE",
"value": "0"
}, {
"type": "AVAILABLE_BITRATE",
"value": ""
}, {
"type": "GET_LIVE_DURATION",
"value": ""
}]
}
},
"error": null,
"data": null
}
|
Example[edit]
Screenshot[edit]
Code[edit]
{
"type": "pages",
"headline": "Tizen Player Test",
"template": {
"type": "separate",
"layout": "0,0,2,4",
"icon": "msx-white-soft:extension",
"color": "msx-glass",
"playerLabel": "Sintel © copyright Blender Foundation | durian.blender.org",
"action": "video:plugin:http://msx.benzac.de/plugins/html5x.html?url=http://msx.benzac.de/media/sintel/sintel.mp4",
"properties": {
"resume:position": "102",
"button:content:icon": "{context:contentIcon}",
"button:content:action": "{context:contentAction}",
"html5x:subtitle:en:English": "http://msx.benzac.de/media/sintel/en.vtt",
"html5x:subtitle:de:Deutsch": "http://msx.benzac.de/media/sintel/de.vtt",
"html5x:subtitle:es:Español": "http://msx.benzac.de/media/sintel/es.vtt",
"html5x:subtitle:fr:Français": "http://msx.benzac.de/media/sintel/fr.vtt",
"html5x:subtitle:it:Italiano": "http://msx.benzac.de/media/sintel/it.vtt",
"html5x:subtitle:nl:Nederlands": "http://msx.benzac.de/media/sintel/nl.vtt",
"html5x:subtitle:pl:Język polski": "http://msx.benzac.de/media/sintel/pl.vtt",
"html5x:subtitle:pt:Português": "http://msx.benzac.de/media/sintel/pt.vtt",
"html5x:subtitle:ru:Pусский": "http://msx.benzac.de/media/sintel/ru.vtt"
}
},
"items": [{
"title": "Sintel 1",
"titleFooter": "Audio & Subtitles",
"contentIcon": "settings",
"contentAction": "panel:request:player:options"
}, {
"title": "Sintel 2",
"titleFooter": "Audio only",
"contentIcon": "audiotrack",
"contentAction": "panel:request:player:audiotrack"
}, {
"title": "Sintel 3",
"titleFooter": "Subtitles only",
"contentIcon": "subtitles",
"contentAction": "panel:request:player:subtitle"
}]
}
Demo[edit]
- Launch via App: http://msx.benzac.de/?start=content:http://msx.benzac.de/info/xp/data/tizen_test.json
- Launch via Demo Page: http://msx.benzac.de/info/?start=content:http://msx.benzac.de/info/xp/data/tizen_test.json
Note: This demo only works properly on a Samsung TV (2016+ models) with Media Station X 0.1.128 or higher.