Device native methods are called through the base SB
object. You can extend it and add your own new platform.
After SB.ready
a current platform has been already defined and is kept in SB
.
SB.platformName
SB.keys
SB.platformUserAgent
SB.getDUID
SB.getNativeDUID
SB.getSDI
SB.getRandomDUID
SB.getMac
SB.setPlugins
SB.setData(name, value)
SB.getData(name)
SB.removeData(name)
New platform adding
String: platform name (samsung, lg, philips, etc...)
Plain object: hash containing keys codes and them names.
BLUE
CH_DOWN
CH_UP
DOWN
ENTER
EXIT
FF
GREEN
INFO
LEFT
N0
N1
N2
N3
N4
N5
N6
N7
N8
N9
NEXT
PAUSE
PLAY
PRECH
PREV
REC
RED
RETURN
RIGHT
RW
SMART
STOP
SUBT
TOOLS
UP
YELLOW
String unique string for platform. It's compare with environment userAgent in SB.detect
method
SB.platformUserAgent === 'netcast'; // for philips
SB.platformUserAgent === 'maple'; // for samsung
Function return platform DUID in case of SB.config.DUID
String DUID
Function return native DUID if exist
String DUID or empty string
Function return platform SDI if exist
String SDI or empty string
Function return random DUID
String generated DUID, for example: "1446dcfb2ca1091"
Function return platform MAC if exist
String MAC or empty string
Function initialize & start plugins specific for platform function calls automatically with smartbox initialization
Function save data in platform storage
name
String data namevalue
(*) data value
Function return value from platform storage
name
String data name
(*) data value
Function remove data from platform storage
name
String data name
You can add a new plaform using function SB.createPlatform(platformName, cb)
var platformName = 'myPlatform';
SB.createPlatform(platformName, {
//platform methods
});