Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Filter
Develop Smart Signage
docconsole log "buffering start " ; }, onbufferingprogress function percent { console log "buffering progress data " + percent ; }, onbufferingcomplete function { console log "buffering complete " ; }, onstreamcompleted function { console log "stream completed" ; webapis avplay stop ; }, oncurrentplaytime function currenttime { console log "current playtime " + currenttime ; }, onerror function eventtype { console log "event type error " + eventtype ; }, onevent function eventtype, eventdata { console log "event type " + eventtype + ", data " + eventdata ; }, onsubtitlechange function duration, text, data3, data4 { console log "subtitletext " + text ; }, ondrmevent function drmevent, drmdata { console log "drm callback " + drmevent + ", data " + drmdata ; } }; webapis avplay setlistener listener ; for video media, set the media display area using the setdisplayrect method the setdisplayrect method takes 4 parameters the position from the left side of the screen, the position from the top of the screen, the width, and the height for the purpose of the setdisplayrect method parameters, the tv screen resolution is always treated as 1920x1080 px, regardless of the application resolution or viewport size if the application resolution is 1920x1080 px, simply set the same position values as defined in the object element style attribute otherwise, you must calculate the values for the setdisplayrect method parameters // for example, video positon is // left 100 px / top 200 px / width 600 px / height 400 px // case 1 application resolution 1920x1080 px webapis avplay setdisplayrect 100,200,600,400 ; // case 2 other application resolution // base resolution of avplay var avplaybasewidth = 1920; // calculate ratio to base resolution var ratio = avplaybasewidth / window document documentelement clientwidth; // convert rectangle to base resolution var newleft = 100 * ratio; var newtop = 200 * ratio; var newwidth = 600 * ratio; var newheight = 400 * ratio; webapis avplay setdisplayrect newleft,newtop,newwidth,newheight ; noteif you use the setdisplayrect method to change the media display area size or position during media playback, the object element style attribute must also be changed correspondingly by default, video is displayed full screen within the media display area to fit the video to the media display area webapis avplay setdisplaymethod 'player_display_mode_letter_box' prepare the media for playback, synchronously or asynchronously to prepare the media synchronously, use the prepare method because preparation can involve fetching and decoding media data, the prepare method can take a long time to execute do not call it from your application’s ui thread, as it causes the ui to hang until execution is finished webapis avplay prepare ; to prepare the media asynchronously, use the prepareasync method this method starts preparing in the background and returns immediately when the media is finished preparing, the successcallback method is invoked var successcallback = function { console log 'the media has finished preparing' ; } var errorcallback = function { console log 'the media has failed to prepare' ; } webapis avplay prepareasync successcallback,errorcallback ; when the avplay instance starts preparing the media, the onbufferingstart event handler is invoked, and the avplay instance enters the ready state to manage starting and stopping playback start playback using the play method webapis avplay play ; when playback starts, the oncurrentplaytime event handler is invoked, and the avplay instance enters the playing state pause playback using the pause method webapis avplay pause ; the avplay instance enters the paused state playback can be resumed using the play method when playback is complete, stop the player webapis avplay stop ; the avplay instance enters the idle state the instance retains its configuration, such as the media uri, display area, and event methods to replay the media, you can simply call the prepare and play methods again notefailure to stop playback after the media has finished playing causes the media player window to show the final frame continuously to remove the avplay instance, call the close method managing media playback using the avplay api, you can implement functionalities such as jumping to a specific time in the media, adjusting the playback rate, and switching audio tracks media seek you can jump to a specific time in the media based on an absolute time or relative time to jump based on an absolute time, use the seekto method retrieve the current playback time using the getcurrenttime method set the time to jump to the new time must be a positive value, which is less than the duration of the media //media seek during playback var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } //jump forward by 5000 ms var currenttime = webapis avplay getcurrenttime ; var newtime = currenttime + 5000; webapis avplay seekto newtime,successcallback,errorcallback ; you can also set the start position for media playback by calling the seekto method when the avplay instance is in the idle state //change playback start time var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } webapis avplay open 'yourmediauri' ; //move the playback start time to 10 minutes webapis avplay seekto 600000,successcallback,errorcallback ; webapis avplay prepare ; to jump based on a relative time, use the jumpforward and jumpbackward methods //media seek during playback var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } //case 1 fast-forward by 5000 ms webapis avplay jumpfoward 5000,successcallback,errorcallback ; //case 2 rewind by 5000 ms webapis avplay jumpbackward 5000,successcallback,errorcallback ; noteyou must check that the value of the parameter is within the valid range, based on the current playback time playback rate control trick play you can control the playback rate of the media using the setspeed method to set a multiplier for the playback rate positive parameter values play the media forwards, while negative values cause the media to play in reverse for example, to play the media at double speed webapis avplay setspeed 2 ; the maximum playback rate depends on the streaming format streaming format playback rate range smooth streaming -16x ~ +16x http s -8x ~ +8x mpeg-dash -16x ~ +16x http live streaming hls since 2017 models -16x ~ +16xfor content with ext-x-i-frame-stream_inf tag only table 3 playback rates for streaming formats audio track switching to switch between multiple audio tracks during media playback retrieve the audio track list the gettotaltrackinfo method of the avplay api can only be called when the avplay instance is in the ready, playing, or paused states it returns an array of objects for all tracks in the media each object has 3 properties type the audio value identifies the track as an audio track index the index number for the track extra_info additional information about the track, such as language information and number of channels var totaltrackinfo = webapis avplay gettotaltrackinfo ; for var i=0; i<totaltrackinfo length;i++ { if totaltrackinfo type =='audio' { console log 'find audio track ' ; console log 'audio track index is ' + totaltrackinfo index ; console log 'audio track language is ' + totaltrackinfo extra_info language ; } } select the audio track call the setselecttrack method with the track type and index number as parameters // select audio track with index 2 webapis avplay setselecttrack 'audio',2 ; drm contents playback sequence you can play drm contents as setting drm properties for each drm case properly using setdrm method in idle state and, as using ondrmevent callback function, you can handle errors caused by incorrect drm settings or environments, and in the playready genchallenge case or widevine modular case, you can get the challenge data from avplay and get the license data from the license server through the corresponding the challenge data below figures are sequence diagram for each drm case, you can refer to the detailed information at the link drm support in streaming contents setdrm method ondrmevent callback drm version mse/eme playready getrights case this method is driven by the avplay creation of challenge data and acquiring license data directly from license server and performing install it self if license server require addition properties for acquiring license data e g http header, user agent, cookie, etc , application should call setdrm "playready", "setproperties", json_object method with setting additional data corresponding to key and value of json object as the example code below to execute this case, either set the value for "getchallenge" into false or do not set "getchallenge" property for "setproperties" drmoperation in setdrm avplay api sample codefunction drmeventcallback event, data { if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "deletelicenseafteruse" true, // optional field "cookie" "your cookie", "licenseserver" "license server url", "httpheader" "http header which license server required ", "useragent" "your user agent" }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "playready", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram playready genchallenge case since tizen 2018 avplay passes the challenge data to the ondrmevent callback function the application should acquire and install the license data using setdrm "playready", "installlicense", license_data directly from the license server by using jquery ajax method, xmlhttpreuqest class, etc to execute this case, "getchallenge" property for "setproperties" drmoperation should set to true via setdrm avplay api sample codefunction drmeventcallback event, data { // challenge case if data name == "challenge" { // request license data from license server via http post $ ajax { url license_server_url, data atob data challenge , headers { "content-type" "text/xml", }, type 'post', datatype 'text', cache false, processdata false } success function msg, status { webapi avplay setdrm "playready", "installlicense", btoa msg ; } ; } else if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "deletelicenseafteruse" true, "getchallenge" true }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "playready", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram verimatrix case sample codefunction drmeventcallback event, data { if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "companyname" yourcompany, "iptv" public2 example verimatrix com, web public-ott-nodrm example verimatrix com 8080 }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "verimatrix", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram widevine modular case as with playready genchallenge scenario, the application should acquire license data as challenge data to the license server and install using setdrm "widevine_cdm", "widevine_license_data", license_data when sending a request, the application should set the license server information wvjson license_server and if necessary, the application can set the extra information such as wvjson wvheader sample codefunction drmeventcallback event, data { // challenge case if data name == "challenge" { // request license data from license server via http post var message = atob data challenge ; // the challenge data is base64 encoded type // <--the application should follow the server interface guide when acquiring license data --> var xmlhttp = new xmlhttprequest ; xmlhttp responsetype = "arraybuffer"; xmlhttp open "post", wvjson license_server, true ; xmlhttp setrequestheader "pallycon-customdata", wvjson wvheader ; xmlhttp onload = function e { if this status == 200 { if this response { var licenseparam = data session_id + "param_start_position" + btoa this response + "param_start_position"; webapi avplay setdrm "widevine_cdm", "widevine_license_data", licenseparam ; } } }; xmlhttp send message ; //<-- server interface guide --> } else if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "appsession" yourappsession, "datatype" "matroska_webm" // the application should set datatype when the value is 'matroska_webm' }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "widevine_cdm", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram state limitations for avplay api methods the following table lists the avplay api methods and their valid states unless otherwise specified, calling the method does not change the state of the avplay instance method valid states notes getversion any - open none, idle after a successful call during a valid state, the instance enters the idle state prepare idle, ready after a successful call during a valid state, the instance enters the ready state prepareasync play ready, playing, paused after a successful call during a valid state, the instance enters the playing state pause playing, paused after a successful call during a valid state, the instance enters the paused state stop any after a successful call, the instance enters the idle state close after a successful call, the instance is removed and enters the none state setdisplayrect idle, ready, playing, paused - seekto jumpforward ready, playing, paused jumpbackward getstate any getduration getcurrenttime setlistener setspeed ready, playing, paused setdrm none, idle none state is supported for verimatrix "getuid" operation only setexternalsubtitlepath idle, ready, playing, paused - setsubtitleposition playing, paused setsilentsubtitle idle, ready, playing, paused setdisplaymethod setselecttrack ready, playing, paused ready state is supported for smooth streaming only gettotaltrackinfo ready state is supported for synchronous prepare method only getcurrentstreaminfo - setstreamingproperty idle getstreamingproperty ready, playing, paused setbufferingparam idle suspend ready, playing, paused restore playing, paused table 4 avplay api method state limitations
Develop Smart TV
docconsole log "buffering start " ; }, onbufferingprogress function percent { console log "buffering progress data " + percent ; }, onbufferingcomplete function { console log "buffering complete " ; }, onstreamcompleted function { console log "stream completed" ; webapis avplay stop ; }, oncurrentplaytime function currenttime { console log "current playtime " + currenttime ; }, onerror function eventtype { console log "event type error " + eventtype ; }, onevent function eventtype, eventdata { console log "event type " + eventtype + ", data " + eventdata ; }, onsubtitlechange function duration, text, data3, data4 { console log "subtitletext " + text ; }, ondrmevent function drmevent, drmdata { console log "drm callback " + drmevent + ", data " + drmdata ; } }; webapis avplay setlistener listener ; for video media, set the media display area using the setdisplayrect method the setdisplayrect method takes 4 parameters the position from the left side of the screen, the position from the top of the screen, the width, and the height for the purpose of the setdisplayrect method parameters, the tv screen resolution is always treated as 1920x1080 px, regardless of the application resolution or viewport size if the application resolution is 1920x1080 px, simply set the same position values as defined in the object element style attribute otherwise, you must calculate the values for the setdisplayrect method parameters // for example, video positon is // left 100 px / top 200 px / width 600 px / height 400 px // case 1 application resolution 1920x1080 px webapis avplay setdisplayrect 100,200,600,400 ; // case 2 other application resolution // base resolution of avplay var avplaybasewidth = 1920; // calculate ratio to base resolution var ratio = avplaybasewidth / window document documentelement clientwidth; // convert rectangle to base resolution var newleft = 100 * ratio; var newtop = 200 * ratio; var newwidth = 600 * ratio; var newheight = 400 * ratio; webapis avplay setdisplayrect newleft,newtop,newwidth,newheight ; noteif you use the setdisplayrect method to change the media display area size or position during media playback, the object element style attribute must also be changed correspondingly by default, video is displayed full screen within the media display area to fit the video to the media display area webapis avplay setdisplaymethod 'player_display_mode_letter_box' prepare the media for playback, synchronously or asynchronously to prepare the media synchronously, use the prepare method because preparation can involve fetching and decoding media data, the prepare method can take a long time to execute do not call it from your application’s ui thread, as it causes the ui to hang until execution is finished webapis avplay prepare ; to prepare the media asynchronously, use the prepareasync method this method starts preparing in the background and returns immediately when the media is finished preparing, the successcallback method is invoked var successcallback = function { console log 'the media has finished preparing' ; } var errorcallback = function { console log 'the media has failed to prepare' ; } webapis avplay prepareasync successcallback,errorcallback ; when the avplay instance starts preparing the media, the onbufferingstart event handler is invoked, and the avplay instance enters the ready state to manage starting and stopping playback start playback using the play method webapis avplay play ; when playback starts, the oncurrentplaytime event handler is invoked, and the avplay instance enters the playing state pause playback using the pause method webapis avplay pause ; the avplay instance enters the paused state playback can be resumed using the play method when playback is complete, stop the player webapis avplay stop ; the avplay instance enters the idle state the instance retains its configuration, such as the media uri, display area, and event methods to replay the media, you can simply call the prepare and play methods again notefailure to stop playback after the media has finished playing causes the media player window to show the final frame continuously to remove the avplay instance, call the close method managing media playback using the avplay api, you can implement functionalities such as jumping to a specific time in the media, adjusting the playback rate, and switching audio tracks media seek you can jump to a specific time in the media based on an absolute time or relative time to jump based on an absolute time, use the seekto method retrieve the current playback time using the getcurrenttime method set the time to jump to the new time must be a positive value, which is less than the duration of the media //media seek during playback var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } //jump forward by 5000 ms var currenttime = webapis avplay getcurrenttime ; var newtime = currenttime + 5000; webapis avplay seekto newtime,successcallback,errorcallback ; you can also set the start position for media playback by calling the seekto method when the avplay instance is in the idle state //change playback start time var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } webapis avplay open 'yourmediauri' ; //move the playback start time to 10 minutes webapis avplay seekto 600000,successcallback,errorcallback ; webapis avplay prepare ; to jump based on a relative time, use the jumpforward and jumpbackward methods //media seek during playback var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } //case 1 fast-forward by 5000 ms webapis avplay jumpfoward 5000,successcallback,errorcallback ; //case 2 rewind by 5000 ms webapis avplay jumpbackward 5000,successcallback,errorcallback ; noteyou must check that the value of the parameter is within the valid range, based on the current playback time playback rate control trick play you can control the playback rate of the media using the setspeed method to set a multiplier for the playback rate positive parameter values play the media forwards, while negative values cause the media to play in reverse for example, to play the media at double speed webapis avplay setspeed 2 ; the maximum playback rate depends on the streaming format streaming format playback rate range smooth streaming -16x ~ +16x http s -8x ~ +8x mpeg-dash -16x ~ +16x http live streaming hls since 2017 models -16x ~ +16xfor content with ext-x-i-frame-stream_inf tag only table 3 playback rates for streaming formats audio track switching to switch between multiple audio tracks during media playback retrieve the audio track list the gettotaltrackinfo method of the avplay api can only be called when the avplay instance is in the ready, playing, or paused states it returns an array of objects for all tracks in the media each object has 3 properties type the audio value identifies the track as an audio track index the index number for the track extra_info additional information about the track, such as language information and number of channels var totaltrackinfo = webapis avplay gettotaltrackinfo ; for var i=0; i<totaltrackinfo length;i++ { if totaltrackinfo type =='audio' { console log 'find audio track ' ; console log 'audio track index is ' + totaltrackinfo index ; console log 'audio track language is ' + totaltrackinfo extra_info language ; } } select the audio track call the setselecttrack method with the track type and index number as parameters // select audio track with index 2 webapis avplay setselecttrack 'audio',2 ; drm contents playback sequence you can play drm contents as setting drm properties for each drm case properly using setdrm method in idle state and, as using ondrmevent callback function, you can handle errors caused by incorrect drm settings or environments, and in the playready genchallenge case or widevine modular case, you can get the challenge data from avplay and get the license data from the license server through the corresponding the challenge data below figures are sequence diagram for each drm case, you can refer to the detailed information at the link drm support in streaming contents setdrm method ondrmevent callback drm version mse/eme playready getrights case this method is driven by the avplay creation of challenge data and acquiring license data directly from license server and performing install it self if license server require addition properties for acquiring license data e g http header, user agent, cookie, etc , application should call setdrm "playready", "setproperties", json_object method with setting additional data corresponding to key and value of json object as the example code below to execute this case, either set the value for "getchallenge" into false or do not set "getchallenge" property for "setproperties" drmoperation in setdrm avplay api sample codefunction drmeventcallback event, data { if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "deletelicenseafteruse" true, // optional field "cookie" "your cookie", "licenseserver" "license server url", "httpheader" "http header which license server required ", "useragent" "your user agent" }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "playready", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram playready genchallenge case since tizen 2018 avplay passes the challenge data to the ondrmevent callback function the application should acquire and install the license data using setdrm "playready", "installlicense", license_data directly from the license server by using jquery ajax method, xmlhttpreuqest class, etc to execute this case, "getchallenge" property for "setproperties" drmoperation should set to true via setdrm avplay api sample codefunction drmeventcallback event, data { // challenge case if data name == "challenge" { // request license data from license server via http post $ ajax { url license_server_url, data atob data challenge , headers { "content-type" "text/xml", }, type 'post', datatype 'text', cache false, processdata false } success function msg, status { webapi avplay setdrm "playready", "installlicense", btoa msg ; } ; } else if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "deletelicenseafteruse" true, "getchallenge" true }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "playready", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram verimatrix case sample codefunction drmeventcallback event, data { if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "companyname" yourcompany, "iptv" public2 example verimatrix com, web public-ott-nodrm example verimatrix com 8080 }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "verimatrix", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram widevine modular case as with playready genchallenge scenario, the application should acquire license data as challenge data to the license server and install using setdrm "widevine_cdm", "widevine_license_data", license_data when sending a request, the application should set the license server information wvjson license_server and if necessary, the application can set the extra information such as wvjson wvheader sample codefunction drmeventcallback event, data { // challenge case if data name == "challenge" { // request license data from license server via http post var message = atob data challenge ; // the challenge data is base64 encoded type // <--the application should follow the server interface guide when acquiring license data --> var xmlhttp = new xmlhttprequest ; xmlhttp responsetype = "arraybuffer"; xmlhttp open "post", wvjson license_server, true ; xmlhttp setrequestheader "pallycon-customdata", wvjson wvheader ; xmlhttp onload = function e { if this status == 200 { if this response { var licenseparam = data session_id + "param_start_position" + btoa this response + "param_start_position"; webapi avplay setdrm "widevine_cdm", "widevine_license_data", licenseparam ; } } }; xmlhttp send message ; //<-- server interface guide --> } else if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "appsession" yourappsession, "datatype" "matroska_webm" // the application should set datatype when the value is 'matroska_webm' }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "widevine_cdm", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram state limitations for avplay api methods the following table lists the avplay api methods and their valid states unless otherwise specified, calling the method does not change the state of the avplay instance method valid states notes getversion any - open none, idle after a successful call during a valid state, the instance enters the idle state prepare idle, ready after a successful call during a valid state, the instance enters the ready state prepareasync play ready, playing, paused after a successful call during a valid state, the instance enters the playing state pause playing, paused after a successful call during a valid state, the instance enters the paused state stop any after a successful call, the instance enters the idle state close after a successful call, the instance is removed and enters the none state setdisplayrect idle, ready, playing, paused - seekto jumpforward ready, playing, paused jumpbackward getstate any getduration getcurrenttime setlistener setspeed ready, playing, paused setdrm none, idle none state is supported for verimatrix "getuid" operation only setexternalsubtitlepath idle, ready, playing, paused - setsubtitleposition playing, paused setsilentsubtitle idle, ready, playing, paused setdisplaymethod setselecttrack ready, playing, paused ready state is supported for smooth streaming only gettotaltrackinfo ready state is supported for synchronous prepare method only getcurrentstreaminfo - setstreamingproperty idle getstreamingproperty ready, playing, paused setbufferingparam idle suspend ready, playing, paused restore playing, paused table 4 avplay api method state limitations
Develop Smart Hospitality Display
docconsole log "buffering start " ; }, onbufferingprogress function percent { console log "buffering progress data " + percent ; }, onbufferingcomplete function { console log "buffering complete " ; }, onstreamcompleted function { console log "stream completed" ; webapis avplay stop ; }, oncurrentplaytime function currenttime { console log "current playtime " + currenttime ; }, onerror function eventtype { console log "event type error " + eventtype ; }, onevent function eventtype, eventdata { console log "event type " + eventtype + ", data " + eventdata ; }, onsubtitlechange function duration, text, data3, data4 { console log "subtitletext " + text ; }, ondrmevent function drmevent, drmdata { console log "drm callback " + drmevent + ", data " + drmdata ; } }; webapis avplay setlistener listener ; for video media, set the media display area using the setdisplayrect method the setdisplayrect method takes 4 parameters the position from the left side of the screen, the position from the top of the screen, the width, and the height for the purpose of the setdisplayrect method parameters, the tv screen resolution is always treated as 1920x1080 px, regardless of the application resolution or viewport size if the application resolution is 1920x1080 px, simply set the same position values as defined in the object element style attribute otherwise, you must calculate the values for the setdisplayrect method parameters // for example, video positon is // left 100 px / top 200 px / width 600 px / height 400 px // case 1 application resolution 1920x1080 px webapis avplay setdisplayrect 100,200,600,400 ; // case 2 other application resolution // base resolution of avplay var avplaybasewidth = 1920; // calculate ratio to base resolution var ratio = avplaybasewidth / window document documentelement clientwidth; // convert rectangle to base resolution var newleft = 100 * ratio; var newtop = 200 * ratio; var newwidth = 600 * ratio; var newheight = 400 * ratio; webapis avplay setdisplayrect newleft,newtop,newwidth,newheight ; noteif you use the setdisplayrect method to change the media display area size or position during media playback, the object element style attribute must also be changed correspondingly by default, video is displayed full screen within the media display area to fit the video to the media display area webapis avplay setdisplaymethod 'player_display_mode_letter_box' prepare the media for playback, synchronously or asynchronously to prepare the media synchronously, use the prepare method because preparation can involve fetching and decoding media data, the prepare method can take a long time to execute do not call it from your application’s ui thread, as it causes the ui to hang until execution is finished webapis avplay prepare ; to prepare the media asynchronously, use the prepareasync method this method starts preparing in the background and returns immediately when the media is finished preparing, the successcallback method is invoked var successcallback = function { console log 'the media has finished preparing' ; } var errorcallback = function { console log 'the media has failed to prepare' ; } webapis avplay prepareasync successcallback,errorcallback ; when the avplay instance starts preparing the media, the onbufferingstart event handler is invoked, and the avplay instance enters the ready state to manage starting and stopping playback start playback using the play method webapis avplay play ; when playback starts, the oncurrentplaytime event handler is invoked, and the avplay instance enters the playing state pause playback using the pause method webapis avplay pause ; the avplay instance enters the paused state playback can be resumed using the play method when playback is complete, stop the player webapis avplay stop ; the avplay instance enters the idle state the instance retains its configuration, such as the media uri, display area, and event methods to replay the media, you can simply call the prepare and play methods again notefailure to stop playback after the media has finished playing causes the media player window to show the final frame continuously to remove the avplay instance, call the close method managing media playback using the avplay api, you can implement functionalities such as jumping to a specific time in the media, adjusting the playback rate, and switching audio tracks media seek you can jump to a specific time in the media based on an absolute time or relative time to jump based on an absolute time, use the seekto method retrieve the current playback time using the getcurrenttime method set the time to jump to the new time must be a positive value, which is less than the duration of the media //media seek during playback var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } //jump forward by 5000 ms var currenttime = webapis avplay getcurrenttime ; var newtime = currenttime + 5000; webapis avplay seekto newtime,successcallback,errorcallback ; you can also set the start position for media playback by calling the seekto method when the avplay instance is in the idle state //change playback start time var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } webapis avplay open 'yourmediauri' ; //move the playback start time to 10 minutes webapis avplay seekto 600000,successcallback,errorcallback ; webapis avplay prepare ; to jump based on a relative time, use the jumpforward and jumpbackward methods //media seek during playback var successcallback = function { console log 'media seek successful' ; } var errorcallback = function { console log 'media seek failed' ; } //case 1 fast-forward by 5000 ms webapis avplay jumpfoward 5000,successcallback,errorcallback ; //case 2 rewind by 5000 ms webapis avplay jumpbackward 5000,successcallback,errorcallback ; noteyou must check that the value of the parameter is within the valid range, based on the current playback time playback rate control trick play you can control the playback rate of the media using the setspeed method to set a multiplier for the playback rate positive parameter values play the media forwards, while negative values cause the media to play in reverse for example, to play the media at double speed webapis avplay setspeed 2 ; the maximum playback rate depends on the streaming format streaming format playback rate range smooth streaming -16x ~ +16x http s -8x ~ +8x mpeg-dash -16x ~ +16x http live streaming hls since 2017 models -16x ~ +16xfor content with ext-x-i-frame-stream_inf tag only table 3 playback rates for streaming formats audio track switching to switch between multiple audio tracks during media playback retrieve the audio track list the gettotaltrackinfo method of the avplay api can only be called when the avplay instance is in the ready, playing, or paused states it returns an array of objects for all tracks in the media each object has 3 properties type the audio value identifies the track as an audio track index the index number for the track extra_info additional information about the track, such as language information and number of channels var totaltrackinfo = webapis avplay gettotaltrackinfo ; for var i=0; i<totaltrackinfo length;i++ { if totaltrackinfo type =='audio' { console log 'find audio track ' ; console log 'audio track index is ' + totaltrackinfo index ; console log 'audio track language is ' + totaltrackinfo extra_info language ; } } select the audio track call the setselecttrack method with the track type and index number as parameters // select audio track with index 2 webapis avplay setselecttrack 'audio',2 ; drm contents playback sequence you can play drm contents as setting drm properties for each drm case properly using setdrm method in idle state and, as using ondrmevent callback function, you can handle errors caused by incorrect drm settings or environments, and in the playready genchallenge case or widevine modular case, you can get the challenge data from avplay and get the license data from the license server through the corresponding the challenge data below figures are sequence diagram for each drm case, you can refer to the detailed information at the link drm support in streaming contents setdrm method ondrmevent callback drm version mse/eme playready getrights case this method is driven by the avplay creation of challenge data and acquiring license data directly from license server and performing install it self if license server require addition properties for acquiring license data e g http header, user agent, cookie, etc , application should call setdrm "playready", "setproperties", json_object method with setting additional data corresponding to key and value of json object as the example code below to execute this case, either set the value for "getchallenge" into false or do not set "getchallenge" property for "setproperties" drmoperation in setdrm avplay api sample codefunction drmeventcallback event, data { if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "deletelicenseafteruse" true, // optional field "cookie" "your cookie", "licenseserver" "license server url", "httpheader" "http header which license server required ", "useragent" "your user agent" }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "playready", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram playready genchallenge case since tizen 2018 avplay passes the challenge data to the ondrmevent callback function the application should acquire and install the license data using setdrm "playready", "installlicense", license_data directly from the license server by using jquery ajax method, xmlhttpreuqest class, etc to execute this case, "getchallenge" property for "setproperties" drmoperation should set to true via setdrm avplay api sample codefunction drmeventcallback event, data { // challenge case if data name == "challenge" { // request license data from license server via http post $ ajax { url license_server_url, data atob data challenge , headers { "content-type" "text/xml", }, type 'post', datatype 'text', cache false, processdata false } success function msg, status { webapi avplay setdrm "playready", "installlicense", btoa msg ; } ; } else if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "deletelicenseafteruse" true, "getchallenge" true }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "playready", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram verimatrix case sample codefunction drmeventcallback event, data { if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "companyname" yourcompany, "iptv" public2 example verimatrix com, web public-ott-nodrm example verimatrix com 8080 }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "verimatrix", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram widevine modular case as with playready genchallenge scenario, the application should acquire license data as challenge data to the license server and install using setdrm "widevine_cdm", "widevine_license_data", license_data when sending a request, the application should set the license server information wvjson license_server and if necessary, the application can set the extra information such as wvjson wvheader sample codefunction drmeventcallback event, data { // challenge case if data name == "challenge" { // request license data from license server via http post var message = atob data challenge ; // the challenge data is base64 encoded type // <--the application should follow the server interface guide when acquiring license data --> var xmlhttp = new xmlhttprequest ; xmlhttp responsetype = "arraybuffer"; xmlhttp open "post", wvjson license_server, true ; xmlhttp setrequestheader "pallycon-customdata", wvjson wvheader ; xmlhttp onload = function e { if this status == 200 { if this response { var licenseparam = data session_id + "param_start_position" + btoa this response + "param_start_position"; webapi avplay setdrm "widevine_cdm", "widevine_license_data", licenseparam ; } } }; xmlhttp send message ; //<-- server interface guide --> } else if data name == "drmerror" { // error handling } } function preparecallback { webapi avplay play ; } var json = { "appsession" yourappsession, "datatype" "matroska_webm" // the application should set datatype when the value is 'matroska_webm' }; var properties = json stringify json ; webapi avplay open url ; webapi avplay setlistener {ondrmevent drmeventcallback} ; webapi avplay setdrm "widevine_cdm", "setproperties", properties ; webapi avplay setdisplayrect 0, 0, 1920, 1080 ; webapi avplay prepareasync preparecallback ; webapi avplay stop ; webapi avplay close ; sequence diagram state limitations for avplay api methods the following table lists the avplay api methods and their valid states unless otherwise specified, calling the method does not change the state of the avplay instance method valid states notes getversion any - open none, idle after a successful call during a valid state, the instance enters the idle state prepare idle, ready after a successful call during a valid state, the instance enters the ready state prepareasync play ready, playing, paused after a successful call during a valid state, the instance enters the playing state pause playing, paused after a successful call during a valid state, the instance enters the paused state stop any after a successful call, the instance enters the idle state close after a successful call, the instance is removed and enters the none state setdisplayrect idle, ready, playing, paused - seekto jumpforward ready, playing, paused jumpbackward getstate any getduration getcurrenttime setlistener setspeed ready, playing, paused setdrm none, idle none state is supported for verimatrix "getuid" operation only setexternalsubtitlepath idle, ready, playing, paused - setsubtitleposition playing, paused setsilentsubtitle idle, ready, playing, paused setdisplaymethod setselecttrack ready, playing, paused ready state is supported for smooth streaming only gettotaltrackinfo ready state is supported for synchronous prepare method only getcurrentstreaminfo - setstreamingproperty idle getstreamingproperty ready, playing, paused setbufferingparam idle suspend ready, playing, paused restore playing, paused table 4 avplay api method state limitations
Develop Galaxy Watch for Tizen
docconsole writeline "there are no peers to connect to " ; } else { var peer = peers first ; await peer connection open ; peer connection send agent channels first value, system text encoding ascii getbytes "hello" ; } } except exception exc { console writeline "communication failure " + exc message ; } handling of an incomming connection samsung sap agent agent = null; agent = await samsung sap agent getagent "/my/profile", onconnect con => { if con peer profileversion == agent profileversion { con datareceived += s, e => { console writeline $"received {e data length} bytes from {e peer devicename}/{e channel id}" ; }; return true; // accept connection from peers with the same profile version as ours } else { return false; // reject other connections } } ; 2 disconnect the service connection between peers can be closed by calling connection close method connection close ; 3 send a message in this sample text message is sent using peer sendmessage in contrast to sending data using connection send method establishing connection between peers is not required await peer sendmessage encoding utf8 getbytes "hello message" ; 4 receive a message receiving message from remote peer is handled by onmessage callback set before private async void onmessage peer peer, byte[] content { string message = encoding utf8 getstring content + " time " + datetime now toshorttimestring ; toast displaytext message ; await peer sendmessage encoding utf8 getbytes message ; } in this case, app replies to a receiving command from remote accessory peer agent in smart device by providing the current time stamp
Develop Smart TV
docconsole log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the purchase list api request has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 1 purchase list api request headers the purchase list api request and response data are in json format purchase list api request parameters parameter type mandatory description "appid" string true application id "customid" unique customer id same value as the "ordercustomid" parameter for the buyitem method "countrycode" country code the country code must be retrieved from the tv "itemtype" product type "1" non-consumable and limited-period items"2" all items "pagenumber" number requested page number range 1~n each purchase record page has up to 100 entries to receive the complete purchase record, post purchase list api requests while increasing the "pagenumber" value, until "eof" is returned in the "cpresult" parameter "checkvalue" string security check value required parameters "appid" + "customid" + "countrycode" + "itemtype" + "pagenumber" table 2 purchase list api request parameters purchase list api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" false result message "eof" last page of the purchase history "hasnext true" purchase history has further pages other message corresponding to the "cpstatus" error code "totalcount" number true total number of invoices sum of all purchase history pages, or sum of purchase history in the specified time period "checkvalue" string security check value required parameters "cpstatus" + "cpresult" + "totalcount" + "invoicedetails[0] itemid" + … + "invoicedetails[totalcount] itemid" "invoicedetails" json false invoice information "seq" number true sequence number range 1 ~ totalcount "invoiceid" string invoice id for products with recurring payments, use the subscription id "itemid" product id "itemtitle" product name "itemtype" number product type "1" consumable "2" non-consumable "3" limited-period "4" subscriptionthe response "itemtype" value differs from the request "itemtype" value the response value contains more detail "ordertime" string payment time, in 14-digit utc time "period" number false limited period product duration, in minutes "price" true original product price, in "xxxx yy" format this is price without promotion "ordercurrencyid" string currency code "cancelstatus" boolean cancelation status "true" sale canceled "false" sale ongoing for subscription products, indicates the cancelation status for the next subscription cycle "appliedstatus" product application status "true" applied "false" not applied for subscription products, the default value is "true" "appliedtime" string false time product applied, in 14-digit utc time "limitendtime" true for limited period products only limited period product end time, in 14-digit utc time if the product has not been applied, "limitendtime" is an empty string "remaintime" limited period product time remaining, in seconds "remaintime" = "limitendtime" – request time if the product has not been applied, "remaintime" is an empty string "subscriptioninfo" json false subscription information mandatory for subscription products "subscriptionid" string true subscription id "subsstarttime" subscription start time, in 14-digit utc time "subsendtime" subscription expiry time, in 14-digit utc time "subsstatus" subscription status "00" active"01" subscription expired"02" canceled by buyer"03" canceled for payment failure"04" canceled by cp"05" canceled by admin"06" canceled by gdpr restriction"07" canceled by withdrawn account"08" canceled by unused account"09" canceled by misused blocked account"10" canceled by banned blocked account "lastpaymentamount" latest payment amount, in "xxxx yy" format "lastpaymenttaxamount" tax amount in the latest payment amount, in "xxxx yy" format "lastpaymenttime" latest payment time, in 14-digit utc time "nextcycletime" next payment time, in 14-digit utc time this is the time calculated based on the billing cycle of the subscription and the subscription start time "nextpaymenttime" next actual payment time, in 14-digit utc time this is the time when the payment is charged to the user's payment method "isfreetrialperiod" boolean whether the subscription is currently in the free trial period "true" in free trial period"false" not in free trial periodif the first payment after the free trial period fails, a second attempt is made the next day, in accordance with samsung policy during this grace period, the value of "isfreetrialperiod" is "true" "countrycode" string base country code for the subscription the value is the country set on the tv when the subscription was started "isflexibleofferapplied" boolean whether the subscription has a flexible offer applied for the next payment "true" has a flexible offer applied "false does not have a flexible offer applied "flexibleofferprice" string false flexible offer price, in "xxxx yy" format "flexibleofferremainingcycle" number number of remaining cycles of a flexible offer applied to current subscription table 3 purchase list api response parameters note14-digit utc time is a time representation format based on utc time it uses the following format yyyymmddhh24miss for example, 20181113095011 requesting products for sale the products list api "cont/list" requests product information from the dpi server when the api is in "show" status, it returns the information for the products on sale this api is generally used to generate a list of buyable products in the application to call the products list api // generate checkvalue var reqparams = detailobj appid + detailobj countrycode; /* required parameters [cont/list] request appid + countrycode [checkvalue] required */ var hash = cryptojs hmacsha256 reqparams, securitykey ; var checkvalue = cryptojs enc base64 stringify hash ; detailobj checkvalue = checkvalue; var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/cont/list", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the products list api request has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 4 products list api request headers the products list api request and response data are in json format products list api request parameters parameter type mandatory description "appid" string true application id "countrycode" country code the country code must be retrieved from the tv "productidlist" string[] false list of product ids products in this list are always included in the response even when the product value is "optional" and the product is otherwise not included "pagesize" number false requested page size range 1~n maximum 100 number of products retrieved per page "pagenumber" requested page number range 1~n each purchase record page has a number of entries equal to the "pagesize" value to receive the complete purchase record, post purchase list api requests while increasing the "pagenumber" value, until "eof" is returned in the "cpresult" parameter "checkvalue" string true security check value required parameters "appid" + "countrycode" table 5 products list api request parameters products list api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" false result message "eof" last page of the purchase history "hasnext true" purchase history has further pages other message corresponding to the "cpstatus" error code "totalcount" number true total number of invoices sum of all purchase history pages, or sum of purchase history in the specified time period "checkvalue" string security check value required parameters "cpstatus" + "cpresult" + "totalcount" + "invoicedetails[0] itemid" + … + "invoicedetails[n] itemid" "itemdetails" json false invoice information "seq" number true sequence number range 1 ~ totalcount "itemid" string product id "itemtitle" product name "itemtype" number product type "1" consumable "2" non-consumable "3" limited-period "4" subscription "ordertime" string payment time, in 14-digit utc time "period" number false limited period product duration, in minutes "price" number true product price, in "xxxx yy" format if the product is running a flexible offer, the promotion price is shown during the promotion period, otherwise, the original price is shown "originalprice" original product price, in "xxxx yy" format this field enables you to keep track of the original price during a flexible offer, when the "price" field is changed to the promotion price during the promotion period, if buyitem is called using the original price, eligible users still pay the promotion price "currencyid" string currency code "subscriptioninfo" json false subscription information mandatory for subscription products "paymentcycleperiod" string true subscription payment period "w" weeks"m" months"y" years "paymentcyclefrq" number payment cycle frequency "paymentcycle" number of payment cycles "freetrialdaycount" number of free trial days for the product table 6 products list api response parameters verifying purchases the verify purchase api "invoice/verify" checks whether a purchase, corresponding to the requested "invoiceid", was successful to call the verify purchase api /* required parameters [invoice/verify] request */ var detailobj = new object ; detailobj appid = appid; // your application id detailobj invoiceid = uncanceleditems[key] invoiceid; // issued by "invoice/list" detailobj customid = uniquecustomid; // same value as ordercustomid parameter for buyitem detailobj countrycode = countrycode; // tv country code var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/invoice/verify", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the verify purchase api request has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 7 verify purchase api request headers the verify purchase api request and response data are in json format verify purchase api request parameters parameter type mandatory description "appid" string true application id "invoiceid" invoice id "customid" unique customer id same value as the "ordercustomid" parameter for the buyitem method "countrycode" country code the country code must be retrieved from the tv table 8 verify purchase api request parameters verify purchase api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" false result message "success"other message corresponding to the "cpstatus" error code "appid" true requested application id "invoiceid" requested invoice id table 9 verify purchase api response parameters applying products the apply product api "invoice/apply" supports product management to help guarantee secure sales of your products normally, the dpi service is notified that the purchased product has been successfully applied the apply product api is used in situations where purchase result delivery to the application encounters issues and is not successful for example, if the network connection is interrupted, the application can fail to receive the "payment complete" message, even though the payment was completed in this situation, the product is not applied to the application you can check for unapplied products using the "appliedstatus" parameter of the purchase list api response and apply the product at that time for subscription products, the product is considered applied at the time of purchase and the "appliedstatus" is set to "true" by default consequently, it is not necessary to check whether a subscription product purchase corresponding to the requested "invoiceid" was successful noteto avoid applying the same product more than once in error, after 3 failed attempts to request the apply product api, wait until the network is reconnected before trying again to call the apply product api /* required parameters [invoice/apply] request */ var detailobj = new object ; detailobj appid = appid; // your application id detailobj invoiceid = uncanceleditems[key] invoiceid; // issued by "invoice/list" detailobj customid = uniquecustomid; // same value as ordercustomid parameter for buyitem detailobj countrycode = countrycode; // tv country code var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/invoice/apply", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the apply product api has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 10 apply purchase api request headers the apply product api request and response data are in json format apply product api request parameters parameter type mandatory description "appid" string true application id "invoiceid" invoice id "customid" unique customer id same value as the "ordercustomid" parameter for the buyitem method "countrycode" country code the country code must be retrieved from the tv table 11 apply purchase api request parameters apply product api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" false result message "success"other message corresponding to the "cpstatus" error code "appliedtime" true time product applied, in 14-digit utc time table 12 apply product api response parameters modifying subscription plans retrieve changeable products the subscription plan changeable products api "/subscription/plan-change/changeable-products" retrieves the list of products that a user's subscription can be changed to to call the subscription plan changeable products api // generate checkvalue var reqparams = detailobj appid + detailobj subscriptionid + detailobj timestamp; /* required parameters [subscription/plan-change/changeable-products] request appid + subscriptionid + timestamp [checkvalue] required */ var hash = cryptojs hmacsha256 reqparams, securitykey ; var checkvalue = cryptojs enc base64 stringify hash ; detailobj checkvalue = checkvalue; var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/subscription/plan-change/changeable-products", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the subscription plan changeable products api has the following request headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 13 subscription plan changeable products api request headers the subscription plan changeable products api request and response data are in json format subscription plan changeable products api request parameters parameter type mandatory description "appid" string true application id "subscriptionid" subscription id "productidlist" string[] false list of product ids products in this list are always included in the response even when the product value is "optional" and the product is otherwise not included "timestamp" string true timestamp format "yyyy-mm-dd hh mm ss" the time is in utc time and must be within 10 minutes from the current time "checkvalue" security check value required parameters "appid" + "subscriptionid" + "timestamp" table 14 subscription plan changeable products api request parameters subscription plan changeable products api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" false result message "eof" last page of the purchase history "hasnext true" purchase history has further pages other message corresponding to the "cpstatus" error code "changeableproducts" json true list of changeable products "seq" number true sequence number range 1 ~ totalcount "itemid" string product id "itemtitle" product name "itemtype" number product type "1" consumable "2" non-consumable"3" limited-period "4" subscription the response "itemtype" value differs from the request "itemtype" value the response value contains more detail "period" number false limited period product duration, in minutes "price" true product price, in "xxxx yy" format if the product is running a flexible offer, the promotion price is shown during the promotion period, otherwise, the original price is shown "originalprice" original product price, in "xxxx yy" format this field enables you to keep track of the original price during a flexible offer, when the "price" field is changed to the promotion price "currencyid" string currency code "subscriptioninfo" json false subscription product information "productgroupid" string true subscription product group id "productlevel" number product level in the subscription product group "paymentcycleperiod" string subscription payment period "w" weeks"m" months"y" years "paymentcyclefrq" number payment cycle frequency "paymentcycle" number of payment cycles "freetrialdaycount" number of free trial days for the product table 15 subscription plan changeable products api response parameters pre-check subscription plan changes the subscription plan change pre-check api "subscription/plan-change/pre-check" allows you to preview the impact of switching subscription products to call the subscription plan change pre-check api // generate checkvalue var reqparams = detailobj appid + detailobj subscriptionid + detailobj afterproductid + detailobj timestamp; /* required parameters [subscription/plan-change/pre-check] request appid + subscriptionid + afterproductid + timestamp [checkvalue] required */ var hash = cryptojs hmacsha256 reqparams, securitykey ; var checkvalue = cryptojs enc base64 stringify hash ; detailobj checkvalue = checkvalue; var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/subscription/plan-change/pre-check", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the subscription plan change pre-check api has the following request headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 16 subscription plan change pre-check api request headers the subscription plan change pre-check api request and response data are in json format subscription plan change pre-check api request parameters parameter type mandatory description "appid" string true application id "subscriptionid" subscription id "afterproductid" product id of the new product "timestamp" timestamp format "yyyy-mm-dd hh mm ss" the time is in utc time and must be within 10 minutes from the current time "checkvalue" security check value required parameters "appid" + "subscriptionid" + "afterproductid" + "timestamp" table 17 subscription plan change pre-check api request parameters subscription plan change pre-check api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" result message "success"other message corresponding to the "cpstatus" error code "currentproductname" name of the current subscription product "currentbenefit" json false information about the current benefit mandatory if a benefit is active "type" string true benefit type free_trialcoupon "freetrialdays" integer number of free trial days for the product if a free trial is not active, the value is '0' "couponname" string false name of the coupon applied to the product "enddate" true end date of the free trial or coupon benefit format "yyyy-mm-dd" "afterproductname" string true name of the new product "afterproductprice" price of the new product "afterproductpricetaxincluded" boolean whether the new product price includes tax "true" includes tax"false" does not include tax "afterproductfirstpaymentdate" string estimated date for the first payment on the new product format "yyyy-mm-dd" the date takes into account any free trial days for the new product and, except for subscription upgrades, any benefit period currently active "productcurrencycode" currency code "daysuntilfirstpaymentdate" integer false number of days the upgraded product can be used without additional payment incudes any free trial days for the upgraded product if a free trial period is currently active, the value is '0' and no free trial benefits of the upgraded product are returned mandatory for subscription upgrades "afterproductflexibleofferprice" string flexible offer price of the new product "afterproductflexibleoffercycle" integer number of benefit cycles a flexible offer is applied to the new product "currentproductflexibleofferapplied" boolean true whether the current product has a flexible offer applied "true" has a flexible offer applied"false" does not have a flexible offer applied "currentproductflexibleofferremainingcycle" integer false number of remaining benefit cycles of the current product's flexible offer mandatory when "currentproductflexibleofferapplied" is "true" table 18 subscription plan change pre-check api response parameters reserve subscription plan changes you can use the subscription plan change reserve api "subscription/plan-change/reserve" to request changing the customer's subscription plan to call the subscription plan change reserve api // generate checkvalue var reqparams = detailobj appid + detailobj subscriptionid + detailobj afterproductid + detailobj timestamp; /* required parameters [subscription/plan-change/reserve] request appid + subscriptionid + afterproductid + timestamp [checkvalue] required */ var hash = cryptojs hmacsha256 reqparams, securitykey ; var checkvalue = cryptojs enc base64 stringify hash ; detailobj checkvalue = checkvalue; var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/subscription/plan-change/reserve", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the subscription plan change reserve api request has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 19 subscription plan change reserve api request headers the subscription plan change reserve api request and response data are in json format subscription plan change reserve api request parameters parameter type mandatory description "appid" string true application id "subscriptionid" subscription id "afterproductid" product id of the new product "timestamp" timestamp format "yyyy-mm-dd hh mm ss" the time is in utc time and must be within 10 minutes from the current time "checkvalue" security check value required parameters "appid" + "subscriptionid" + "afterproductid" + "timestamp" "maillang" false iso 639-1 language code in lowercase for the language of messages sent to the user for unsupported languages, use "en" the default value is "en" table 20 subscription plan change reserve api request parameters subscription plan change reserve api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" result message "success"other message corresponding to the "cpstatus" error code "currentproductname" name of the current subscription product "currentbenefit" json false information about the current benefit mandatory if a benefit is active "type" string true benefit type free_trialcoupon "freetrialdays" integer number of free trial days for the product if a free trial is not active, the value is '0' "couponname" string false name of the coupon applied to the product "enddate" true end date of the free trial or coupon benefit format "yyyy-mm-dd" "afterproductname" string true name of the new product "afterproductprice" price of the new product "afterproductpricetaxincluded" boolean whether the new product price includes tax "true" includes tax"false" does not include tax "afterproductfirstpaymentdate" string estimated date for the first payment on the new product format "yyyy-mm-dd" the date takes into account any free trial days for the new product and, except for subscription upgrades, the benefit period currently active "productcurrencycode" currency code "daysuntilfirstpaymentdate" integer false number of days the upgraded product can be used without additional payment includes any free trial days for the upgraded product if a free trial period is currently active, the value is '0' and no free trial benefits of the upgraded product are returned mandatory for subscription upgrades "afterproductflexibleofferprice" string flexible offer price of the new product "afterproductflexibleoffercycle" integer number of benefit cycles a flexible offer is applied to the new product "currentproductflexibleofferapplied" boolean true whether current product has a flexible offer applied "true" has a flexible offer applied"false" does not have a flexible offer applied "currentproductflexibleofferremainingcycle" integer false number of remaining benefit cycles of the current product's flexible offer mandatory when "currentproductflexibleofferapplied" is "true" table 21 subscription plan change reserve api response parameters retrieve subscription plan change reservation status the subscription plan change reservation status api "subscription/plan-change/reserve-status" retrieves the status of any requested subscription changes for a list of subscriptions or customers to call the subscription plan change reservation status api // generate checkvalue var reqparams = detailobj appid; for let subscriptionid of detailobj subscriptionidlist { reqparams += subscriptionid; } for let customid of detailobj customidlist { reqparams += customid; } reqparams += detailobj timestamp; /* required parameters [subscription/plan-change/reserve-status] request appid + subscriptionidlist[0] + + subscriptionidlist[n] + customidlist[0] + + customidlist[n] + timestamp [checkvalue] required */ var hash = cryptojs hmacsha256 reqparams, securitykey ; var checkvalue = cryptojs enc base64 stringify hash ; detailobj checkvalue = checkvalue; var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/subscription/plan-change/reservation-status", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the subscription plan change reservation status api request has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 22 subscription plan change reservation status api request headers the subscription plan change reservation status api request and response data are in json format subscription plan change reservation status api request parameters parameter type mandatory description "appid" string true application id "subscriptionidlist" string[] false list of subscription ids at least one of 'subscriptionidlist' or 'customidlist' must be provided "customidlist" list of unique customer ids at least one of 'subscriptionidlist' or 'customidlist' must be provided "timestamp" string true timestamp format "yyyy-mm-dd hh mm ss" the time is in utc time and must be within 10 minutes from the current time "checkvalue" security check value required parameters "appid" + "subscriptionidlist[0]" + … + "subscriptionidlist[n]" + "customidlist[0]" + … + "customidlist[n]" + "timestamp" table 23 subscription plan change reservation status api request parameters subscription plan change reservation status api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" result message "success"other message corresponding to the "cpstatus" error code "reservedsubscriptions" json[] false list of subscriptions with pending changes "subscription id" string true subscription id "customid" unique customer id "afterproductid" product id of the new product "afterproductname" name of the new product "applydate" estimated date when the new product is applied format "yyyy-mm-dd" table 24 subscription plan change reservation status api response parameters cancel subscription plan change reservations the subscription plan change cancel api "subscription/plan-change/cancel" cancels a requested subscription product change to call the subscription plan change cancel api // generate checkvalue var reqparams = detailobj appid + detailobj subscriptionid + detailobj timestamp; /* required parameters [subscription/plan-change/cancel] request appid + subscriptionid + timestamp [checkvalue] required */ var hash = cryptojs hmacsha256 reqparams, securitykey ; var checkvalue = cryptojs enc base64 stringify hash ; detailobj checkvalue = checkvalue; var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/subscription/plan-change/cancel", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the subscription plan change cancel api request has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 25 subscription plan change cancel api request headers the subscription plan change cancel api request and response data are in json format subscription plan change cancel api request parameters parameter type mandatory description "appid" string true application id "subscriptionid" subscription id "timestamp" timestamp format "yyyy-mm-dd hh mm ss" the time is in utc time and must be within 10 minutes from the current time "checkvalue" security check value required parameters "appid" + "subscriptionid" + "timestamp" "maillang" false iso 639-1 language code in lowercase for the language of messages sent to the user for unsupported languages, use "en" the default value is "en" table 26 subscription plan change cancel api request parameters subscription plan change cancel api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" result message "success"other message corresponding to the "cpstatus" error code table 27 subscription plan change cancel api response parameters canceling subscriptions you can only use the subscription cancel api "subscription/cancel" with subscription products, to request canceling the subscription the dpi server returns the subscription expiry time and the current subscription status to call the subscription cancel api /* required parameters [subscription/cancel] request */ var detailobj = new object ; detailobj appid = appid; // your application id detailobj invoiceid = uncanceleditems [key] invoiceid; // issued by "invoice/list" detailobj customid = uniquecustomid; // same value as ordercustomid parameter for buyitem detailobj countrycode = countrycode; // tv country code var paymentdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/subscription/cancel", type "post", contenttype "application/json;charset=utf-8", datatype "json", data paymentdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the subscription cancel api request has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8""application/x-www-form-urlencoded"for the "x-www-form-urlencoded" data type, the request body must not contain any spaces ' ' "accept" media type accepted by the client "application/json;charset=utf-8" table 28 subscription cancel api request headers the subscription cancel api request and response data are in json format subscription cancel api request parameters parameter type mandatory description "appid" string true application id "invoiceid" invoice id "customid" unique customer id same value as the "ordercustomid" parameter for the buyitem method "countrycode" country code the country code must be retrieved from the tv table 29 subscription cancel api request parameters subscription cancel api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" false result message "success"other message corresponding to the "cpstatus" error code "invoiceid" true invoice id "subscanceltime" false time subscription canceled, in 14-digit utc time "subsstatus" subscription status "02" canceled by buyer table 30 subscription cancel api response parameters checking billing service availability the billing service available country check api "/country/checkavailability" retrieves billing service availability information for the specified country codes to call the billing service available country check api /* required parameters [country/checkavailability] request appid + countrycodes + checkvalue */ var detailobj = new object ; detailobj appid = appid; // your application id detailobj countrycodes = countrycodes; // tv country codes to be checked you can check multiple codes var reqparams = detailobj appid + detailobj countrycodes; var hash = cryptojs hmacsha256 reqparams, securitykey ; var checkvalue = cryptojs enc base64 stringify hash ; detailobj checkvalue = checkvalue; var countrycheckdetails = json stringify detailobj ; // call api $ ajax { url strurldpi + "/country/checkavailability", type "post", contenttype "application/json;charset=utf-8", datatype "json", data countrycheckdetails, timeout 10000, success function res { // for implementation details, see the samsung checkout sample application console log "success " + json stringify res ; }, error function jqxhr, ajaxoptions, thrownerror, request, error { console log "[error] thrownerror "+thrownerror+";error "+error+";[message] "+jqxhr responsetext ; }, complete function { console log "complete" ; }, failure function { console log "failure" ; } } ; the billing service available country check api request has the following headers header mandatory description "content-type" true media type of the message "application/json;charset=utf-8" "accept" media type accepted by the client "application/json" table 31 billing service available country check api request headers the billing service available country check api request and response data are in json format billing service available country check api request parameters parameter type mandatory description "appid" string true application id "countrycodes" country codes in uppercase for the regions to be checked you can check multiple regions with a comma-separated list, for example, "de,us,kr" "checkvalue" security check value required parameters "appid" + "countrycodes" for multiple country codes, remove the commas for example, if "countrycodes" is "de,us,kr", use "deuskr" to generate the check value table 32 billing service available country check api request parameters billing service available country check api response parameters parameter type mandatory description "cpstatus" string true result code "100000" success"errorcode" failure "cpresult" result message "success"other message corresponding to the "cpstatus" error code "countries" json false country information "countrycode" string true country code "isbillingsupported" boolean billing service support status "true" billing service supported"false" billing service not supported table 33 billing service available country check api response parameters billing api to implement the samsung checkout functionality, use the billing api when the user wants to make a purchase, authenticate the user and show the common purchase gui with the buyitem method importantwhen the buyitem method is called, the common purchase gui is shown in the application automatically do not change the purchase gui appearance until the purchase transaction is complete and the application receives the response you can customize the product image in samsung checkout by providing the uri to an image on your own content server to implement samsung checkout var detailobj = new object ; detailobj orderitemid = productslist itemdetails[selecteditem] itemid; // issued by "cont/list" detailobj ordertitle = productslist itemdetails[selecteditem] itemtitle; // issued by "cont/list" detailobj ordertotal = productslist itemdetails[selecteditem] price tostring ; // change data type to string detailobj ordercurrencyid = productslist itemdetails[selecteditem] currencyid; //detailobj orderid = "your_order_id"; // this value is optional var uniquecustomid = "123"; // unique id for this user "123" is an example value it can be an id managed by your service detailobj ordercustomid = uniquecustomid; // same value as "customid" parameter for "invoice/list" var paymentdetails = json stringify detailobj ; webapis billing buyitem appid, servertype, paymentdetails, function data { // for implemention details, see the samsung checkout sample application console log "[billing buyitem] pay_result [" + data payresult + "], pay_detail [" + data paydetail + "]" ; }, function error { console log "[billing buyitem] status [" + error code + "] errorname [" + error name + "] errormessage [" + error message + "]" ; } ; the buyitem method request and response data are in json format buyitem method request parameters parameter type mandatory maximum length characters description "appid" string true 30 application id provided by the samsung apps tv seller office "paymentserver" - possible values "prd" operating zone "paymentdetails" json payment details "orderitemid" string true 30 purchase item id, for example, "dp123400000000" "itemid" issued by the products list api for dynamic products, use this value as "productid" for the verify dynamic product information api "ordertitle" 100 purchase item title "itemtitle" issued by the products list api for dynamic products, use a customized value "ordertotal" 20 total purchase price "price" issued by the products list api when converting the number to string type, pay attention to the unit separators for dynamic products, use a customized value and use it as "productprice" for the verify dynamic product information api "ordercurrencyid" 10 purchase currency unit "currencyid" issued by the products list api "orderid" false 50 management id for purchases managed by third-party applications "ordercustomid" false 100 unique customer id "orderitempath" false - item image uri the image must be in jpeg, jpg, or png format "dynmcproductid" true for dynamic products only 100 unique id for the dynamic product from a third-party application use this value as "dynmcproductid" for the verify dynamic product information api "dynmcproductinfo" false dynamic product item type, such as rental or permanent purchase for dynamic products only "dynmcsharecategory" 20 share category for dynamic products only "dynmctaxcategory" 30 tax category for dynamic products only "stltappid" settlement application id for samsung internal use only do not use table 34 buyitem request parameters buyitem method response parameters parameter type mandatory description "payresult" string true possible values "success""failed""cancel" canceled by the user "paydetail" json false payment details "invoiceid" string false purchased invoice id, for example, "do1904us000007153" a value is only returned when "payresult" is "success" table 35 buyitem response parameters note dynamic products are also supported by samsung checkout for more information on offering dynamic products in your application, contact a samsung representative by going to "samsung apps tv seller office > support" and creating a "1 1 q&a" support ticket verifying dynamic product information the verify dynamic product information api "cp/verify" is only available when the product type is dynamic product the api checks the dynamic product information between dpi server and cp cms the dpi server calls this api when "verification" is selected in the dpi portal api url operating zone prd the "verify uri" entered in the dpi portal for the operating zone post https //xxxxxxxx com/xxxx/cp/verify http/1 1 accept-encoding gzip,deflate content-type application/json;charset=utf-8 accept application/json;charset=utf-8 content-length 391 host xxxx com connection keep-alive user-agent apache-httpclient/4 1 1 java 1 5 { "countrycode" "es", "ordertime" "20181017213438", "checkvalue" "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "productdetail" { "appid" "3201505000000", "productid" "rent_prod", "productprice" "1 58", "productcurrencycode" "usd", "ordercustomid" "xxxxxxxx", "dynmcproductid" "rent_option_4537", "dynmcproductinfo" "rent_option_4537" } } verify dynamic product information api request parameters parameter type mandatory maximum length characters description "countrycode" string true 10 country code in uppercase "ordertime" 20 order time utc-0 20140314175900 "checkvalue" 200 security check value required parameters "appid" + "dynmcproductid" + "productid" + "productprice" + "productcurrencycode" "productdetail" json - product details "appid" string true 30 application id same value as the "appid" parameter for the buyitem method "productid" purchase item id same value as the "orderitemid" parameter for the buyitem method "productprice" 10 purchase price unit price same value as the "ordertotal" parameter for the buyitem method "productcurrencycode" currency code same value as the "ordercurrencyid" parameter for the buyitem method "ordercustomid" false 100 unique customer id same value as the "ordercustomid" parameter for the buyitem method "dynmcproductid" true unique id or string to track the product from the third-party application same value as the "dynmcproductid" parameter for the buyitem method "dynmcproductinfo" false dynamic product information same value as the "dynmcproductinfo" parameter for the buyitem method "dynmcsharecategory" 20 share category for the dynamic product same value as the "dynmcsharecategory" parameter for the buyitem method "dynmctaxcategory" 30 tax category for the dynamic product same value as the "dynmctaxcategory" parameter for the buyitem method table 36 verify dynamic product information api request parameters verify dynamic product information api response parameters parameter type mandatory length description "status" string true 9 result code "100000" success"errorcode" failurefor error code details, see the embedded error code file "result" 100 result message to be displayed "success" or other short error message "resultlongmesg" false 200 detailed error message when debug mode is active table 37 verify dynamic product information api response parameters dpi result codes the following table lists result codes and messages that are returned by the dpi service result code result message description 100000 "success" additional messages "hasnext true" product list or purchase history has further pages"eof" last page of the product list or purchase history"your invoice not found" no purchase history exists 400111 "appid not correct" requested application id does not exist table 38 dpi result codes and messages for explanations of additional dpi result codes, at the dpi portal, go to "help > error code" country and currency codes the following table lists countries with their corresponding country code, currency, and currency code country name country code iso3166-1 alpha-2 currency currency code iso 4217 aland islands ax euro eur albania al united states dollar usd algeria dz algerian dinar dzd argentina ar argentinian peso ars australia au australian dollar aud austria at euro eur bahrain bh bahraini dinar bhd belarus by belarusian ruble byn belgium be euro eur bolivia bo united states dollar usd bosnia and herzegovina ba united states dollar usd brazil br brazilian real brl bulgaria bg bulgarian lev bgn canada ca canadian dollar cad chile cl chilean peso clp colombia co colombian peso cop costa rica cr united states dollar usd croatia hr euro eur czechia cz czech koruna czk denmark dk danish krone dkk dominican republic do united states dollar usd ecuador ec united states dollar usd egypt eg egyptian pound egp estonia ee euro eur faroe islands fo danish krone dkk finland fi euro eur france fr euro eur germany de euro eur greece gr euro eur greenland gl danish krone dkk guatemala gt guatemalan quetzal gtq guernsey gg british pound gbp hong kong hk hong kong dollar hkd hungary hu hungarian forint huf iceland is united states dollar usd india in indian rupee inr indonesia id indonesian rupiah idr iraq iq iraqi dinar iqd ireland ie euro eur isle of man im british pound gbp israel il israeli shekel ils italy it euro eur jersey je british pound gbp jordan jo jordanian dinar jod kazakhstan kz kazakhstani tenge kzt korea, republic of kr south korean won krw kuwait kw kuwaiti dinar kwd kyrgyzstan kg united states dollar usd latvia lv euro eur lebanon lb lebanese pound lbp libya ly libya dinar lyd lithuania lt euro eur luxembourg lu euro eur malaysia my malaysian ringgit myr mexico mx mexican peso mxn moldova md united states dollar usd mongolia mn united states dollar usd montenegro me united states dollar usd morocco ma moroccan dirham mad netherlands nl euro eur new zealand nz new zealand dollar nzd north macedonia mk united states dollar usd norway no norwegian krone nok oman om omani rial omr pakistan pk united states dollar usd panama pa united states dollar usd peru pe peruvian sol pen philippines ph philippine peso php poland pl polish zloty pln portugal pt euro eur qatar qa qatari riyal qar romania ro euro eur russian federation ru russian ruble rub saudi arabia sa saudi rial sar serbia rs serbian dinar rsd singapore sg singapore dollar sgd slovakia sk euro eur slovenia si euro eur south africa za south african rand zar spain es euro eur sweden se swedish krona sek switzerland ch swiss franc chf taiwan tw new taiwan dollar twd tajikistan tj united states dollar usd thailand th thai baht thb tunisia tn tunisian dinar tnd türkiye tr turkish lira try turkmenistan tm united states dollar usd ukraine ua ukrainian hryvna uah united arab emirates ae united arab emirates dirham aed united kingdom gb british pound gbp united states us united states dollar usd uzbekistan uz united states dollar usd venezuela ve united states dollar usd vietnam vn vietnamese dong vnd yemen ye yemeni rial yer table 39 country and currency codes
Develop Smart TV
docconsole log 'msf local error ' + err ; return; } // create a reference to a communication "channel" var channel = service channel 'com yourcompany yourapp' ; // connect to the channel channel connect function err { if err return console error err ; console log 'you are connected' ; } ; // add a message listener this is where you will receive messages from mobile devices channel on 'firemissile', function msg, from { console log from attributes name + ' says, ' + msg ; } ; // add a listener for when another client connects, such as a mobile device channel on 'clientconnect', function client { // send the new client a message channel publish 'say', 'hello '+client attributes name, client id ; } ; } ; enhanced features tls make secure connection noteit need to update mobile library to use tls feature android 2 3 7 higher ios 2 3 8 higher js 2 3 3 higher smartviewsdk can make secure connection between sender and receiver through wss & http refer to latest castvideo sample app 1 setsecuritymode api this api is only receiver app application setsecuritymode securitymode set security mode status to for web socket connection or rest api parameters securitymode - security mode status to set 2 sample code tizen web app receiver app var channel = service channel mchannel ; channel setsecuritymode true ; channel connect {name 'tv'}, function err { if err { return console log err ; } log 'channel connect' ; } ; error code following are the specific errors to able to receive the message in the onerror code description 401 unauthorized error 404 not_found error 500 internal server error
Develop Smart Hospitality Display
apiconsole log "success" ; } function errorcallback error { console log error message ; } try { webapis preview setpreviewdata json stringify previewdata , successcallback, errorcallback ; } catch ex { console log ex message ; } getversion retrieves the preview api version domstring getversion ; return value domstring plugin version exceptions webapiexception with error type unknownerror, for any error code example try { var result = webapis preview getversion ; console log result ; } catch ex { console log ex message ; } setactiondataeventlistener register callback function which is called when the preview tiles are clicked bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; parameters deeplinkcallback callback method to invoke when action event is occured return value bool output of callback registeration exceptions webapiexception with error type unknownerror, for any error deprecated 4 0 code example this method doesnot have sample code because of @deprecated 4 0 unactiondataeventlistener unregister callback function which is called when the preview tiles are clicked void unactiondataeventlistener ; exceptions webapiexception with error type unknownerror, for any error deprecated 4 0 code example this method doesnot have sample code because of @deprecated 4 0 2 full webidl module preview { [nointerfaceobject] interface previewmanagerobject { readonly attribute previewmanager preview; }; webapi implements previewmanagerobject; [nointerfaceobject] interface previewmanager { void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ; domstring getversion ; bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; void unactiondataeventlistener ; }; };
Develop Smart TV
apiconsole log "success" ; } function errorcallback error { console log error message ; } try { webapis preview setpreviewdata json stringify previewdata , successcallback, errorcallback ; } catch ex { console log ex message ; } getversion retrieves the preview api version domstring getversion ; return value domstring plugin version exceptions webapiexception with error type unknownerror, for any error code example try { var result = webapis preview getversion ; console log result ; } catch ex { console log ex message ; } setactiondataeventlistener register callback function which is called when the preview tiles are clicked bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; parameters deeplinkcallback callback method to invoke when action event is occured return value bool output of callback registeration exceptions webapiexception with error type unknownerror, for any error deprecated 4 0 code example this method doesnot have sample code because of @deprecated 4 0 unactiondataeventlistener unregister callback function which is called when the preview tiles are clicked void unactiondataeventlistener ; exceptions webapiexception with error type unknownerror, for any error deprecated 4 0 code example this method doesnot have sample code because of @deprecated 4 0 2 full webidl module preview { [nointerfaceobject] interface previewmanagerobject { readonly attribute previewmanager preview; }; webapi implements previewmanagerobject; [nointerfaceobject] interface previewmanager { void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ; domstring getversion ; bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; void unactiondataeventlistener ; }; };
Develop Mobile KnoX
webconsole, with zero-day support for the most up-to-date features. learn more knox sdks providing unparalleled control to a wide range of galaxy devices. web services api integrate knox cloud services into your own web consoles managed configurations support remote configurations of apps and settings quickly and easily. build and grow with samsung join our partner program designed for business developers. access more development tools, dedicated technical support, and more. learn more watch the success story waterloo regional police services share classified data on knox devices running dex and knox platform for enterprise on blackberry's unified endpoint management (uem) solution. video thumbanil
Develop Smart TV
docconsole log 'success' ; }, function fail { console log 'fail' ; }, ['0px', '0px', '1920px', '1080px'], 'main', 'behind' ; notedo not create background layouts for pip overlay elements
We use cookies to improve your experience on our website and to show you relevant advertising. Manage you settings for our cookies below.
These cookies are essential as they enable you to move around the website. This category cannot be disabled.
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.
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.
You have successfully updated your cookie preferences.