Device configurations are managed by a set of JSON files. Each file represents a device or family of similar devices.
The configuration files are loaded at runtime in the app index and exposed as a Javascript object to the framework.
Configuration is split into two sets. The framework configuration files which specify a set of default values required by the framework itself, and an application file which can override these defaults and include additional configuration properties relevant to an application.
The following properties are required within each framework device configuration:
Used in page construction (see Creating an Index)
Strategy | Description |
---|---|
html5 |
For html5 compatible browsers. Use this if supported by device |
hbbtv |
For hbbtv compatible devices |
samsungmaple |
For samsung devices running in maple mode (use html5 instead unless specifically needed) |
The require modules which should be loaded to implement the device abstraction layer. Each module applies platform specific overrides or implementations that run while the app is starting up. For example, including the antie/devices/anim/noanim
modifier will disable animations for that platform.
The module on which the device is based. This will usually be antie/devices/browserdevice.
Mix-in modules to support common implementations of the abstraction layer. This must contain one module from each of the following namespaces
antie/devices/anim/*
– Animationantie/devices/mediaplayer/*
– Media playbackantie/devices/media/*
– Media playback (deprecated)antie/devices/data/*
– JSON parsingantie/devices/net/*
– Network implementationantie/devices/storage/*
– Persistent storage implementationantie/devices/exit/*
– Application exit methodIt should also include all of the supported modules from
antie/devices/logging/*
- Log output methodModule name | Description |
---|---|
antie/devices/anim/noanim |
Device does not support animation - It will be disabled within the framework. |
antie/devices/anim/css3 |
Animation via css3 transitions - Generally the best performance, if it works use this. |
antie/devices/anim/styletopleft |
Animation via tweening style.top and style.left with JavaScript. For reasonably quick devices which do not support css3. |
antie/devices/anim/scrolloffset |
Deprecated |
Module name | Description |
---|---|
antie/devices/mediaplayer/html5 |
The html5 <video> element is used for media playback. |
antie/devices/mediaplayer/cehtml |
CE-HTML is used for media playback |
antie/devices/mediaplayer/samsung_maple |
Samsung’s Device API and Player object are used for media playback |
Module name | Description |
---|---|
antie/devices/media/html5 |
The html5 <video> element is used for media playback. |
antie/devices/media/cehtml |
CE-HTML is used for media playback |
antie/devices/media/samsung_maple |
Samsung’s Device API and Player object are used for media playback |
Module name | Description |
---|---|
antie/devices/data/nativejson |
ECMAScript 5 JSON object used for parsing |
antie/devices/data/json2 |
Douglas Crockford’s json2.js library used for parsing |
Module name | Description |
---|---|
antie/devices/net/default |
Use XHR for network requests |
Module name | Description |
---|---|
antie/devices/storage/cookie |
Use persistant cookies for storage |
Module name | Description |
---|---|
antie/devices/exit/history |
Exits the application by going to the first item in the browser history |
antie/devices/exit/closewindow |
Exits the application by calling window.close() |
Module name | Description |
---|---|
antie/devices/logging/default |
Log messages are output via the global console object |
antie/devices/logging/onscreen |
Log messages are displayed on screen in a DIV element |
antie/devices/logging/consumelog |
Log messages are disabled |
antie/devices/logging/alert |
Log messages output via window.alert() |
antie/devices/logging/jstestdriver |
Log messages output via the jstestdriver console object (for use within unit tests) |
antie/devices/logging/xhr |
Remote logging |
The framework supports the following log types, in ascending severity
log
debug
info
warn
error
If the logging.level
property is set to one the above types, the framework logs all messages of equal or greater severity then that specified, i.e. the type specified and all those below it in the list.
There are two more options
all
none
Which log all or no messages respectively.
All framework configurations should have this value set to none
. If logging is required it should be overridden by applications only during development.
Details of media support for the device, including codecs, protocols and limits.
The default is %href%
Video specific media information
One or more tags (e.g. %tagname%) used when building media URLs.
An array of supported profile objects. (see below)
Audio specific media information
See steaming.video.mediaURIFormat
An array of supported profile objects. (See below)
profile.protocols
(array of strings)
Supported protocols, eg. ‘http’, ‘https’, ‘rtmp’
profile.encodings
(array of strings)
An array of encodings, e.g. ‘h264’, ‘mp3’, ‘wmv’
profile.maximumBitRate
(integer)
maximum bit rate supported by the device in kbps
profile.maximumVideoLines
(integer, video profiles only)
The maximum number of horizontal lines (i.e. vertical resolution) the device supports. e.g. 1080.
Information about user input
Map from raw key codes to their semantic meanings. Valid symbols for the mappings are as follows (bold are mandatory):
The map may also contain the following shortcuts:
Shortcut | Description |
---|---|
alpha | An array of 2 numbers specifying the range A-Z |
alpha | An array of 2 numbers specifying the range A-Z |
numeric | An array of 2 numbers specifying the range 0-9 |
multitap | Details of number -> character mappings when multi-tap is used. If provided, must contain an array of 10 strings (one for each number). The characters of each string will be cycled through when the digits 0-9 are repeatedly pressed. |
Care should be exercised when using optional keys within an application as not all devices will support them.
Accessibility related device information
Device support of subtitles
An array of MIME types for supported subtitle formats (e.g. application/ttaf+xml
)
Details of resolutions the device’s browser may run in, these must be supported by each application that wishes to run on the device.
layout.width
(integer)
Minimum screen width required for this layout in pixels
layout.height
(integer)
Minimum screen height required for this layout in pixels
layout.module
(string)
Application require module used to configure this layout (%application% tag will be replaced by the application ID)
layout.classes
(array of strings)
CSS Class names to add to the top-level element when this layout is used.
layout.css
(array of strings)
Additional CSS files to load for this layout (relative to the styleBaseUrl passed to the application constructor)
Network related information
Whether a device can successfully load JSON objects via JSONP.
The following properties may be added to framework device configuration files, but are not compulsary
A human readable comment about the configuration
Animation defaults
An animation options object describing how fade-ins should behave. See [Animation][].
An animation options object describing how fade-outs should behave. See [Animation][]. [Animation]: /tal/widgets/animation.html
In addition to the framework configuration, it is likely you will want to specify application specific properties per device.
It is TAL convention to do this via a separate JSON file, then merge the two to a single object
There is a method mergeConfigurations()
in the AntieFramework php class for merging device configurations. Note that mergeConfigurations()
overrides any properties present in the original with those present in the patch.