Cobalt Plugin

Version: 1.0

Status: :black_circle::black_circle::white_circle:

Cobalt plugin for Thunder framework.

Table of Contents

Introduction

Scope

This document describes purpose and functionality of the Cobalt plugin. It includes detailed specification about its configuration, methods and properties provided, as well as notifications sent.

Case Sensitivity

All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.

Acronyms, Abbreviations and Terms

The table below provides and overview of acronyms used in this document and their definitions.

AcronymDescription
APIApplication Programming Interface
HTTPHypertext Transfer Protocol
JSONJavaScript Object Notation; a data interchange format
JSON-RPCA remote procedure call protocol encoded in JSON

The table below provides and overview of terms and abbreviations used in this document and their definitions.

TermDescription
callsignThe name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique.

References

Ref IDDescription
HTTPHTTP specification
JSON-RPCJSON-RPC 2.0 specification
JSONJSON specification
ThunderThunder API Reference

Description

The Cobalt plugin provides web browsing functionality based on the Cobalt engine.

The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [Thunder].

Configuration

The table below lists configuration options of the plugin.

NameTypeDescription
callsignstringPlugin instance name (default: Cobalt)
classnamestringClass name: Cobalt
locatorstringLibrary name: libWPEFrameworkCobalt.so
autostartbooleanDetermines if the plugin shall be started automatically along with the framework
configurationobject(optional)
configuration?.urlstring(optional) The URL that is loaded upon starting the browser
configuration?.languagestring(optional) POSIX-style Language(Locale) ID. Example: ‘en_US’
configuration?.preloadboolean(optional) Enable pre-loading of application
configuration?.autosuspenddelaynumber(optional) Applicable when pre-loading. Number of seconds to wait before suspending the app
configuration?.gstdebugstring(optional) Configure GST_DEBUG environment variable, default: ‘gstplayer:4,2’
configuration?.closurepolicystring(optional) Configures how to handle window close request. Accepted values: [suspend, quit]. Default: ‘quit’
configuration?.systempropertiesobject(optional) Configure some properties queried with Starboard System API
configuration?.systemproperties?.modelnamestring(optional) The production model number of the device
configuration?.systemproperties?.brandnamestring(optional) The name of the brand under which the device is being sold
configuration?.systemproperties?.modelyearstring(optional) The year the device was launched
configuration?.systemproperties?.chipsetmodelnumberstring(optional) The full model number of the main platform chipset
configuration?.systemproperties?.firmwareversionstring(optional) The production firmware version number which the device is currently running
configuration?.systemproperties?.integratornamestring(optional) The original manufacture of the device
configuration?.systemproperties?.friendlynamestring(optional) A friendly name for this actual device
configuration?.systemproperties?.devicetypestring(optional) The type of the device. (must be one of the following: SetTopBox, OverTheTopBox, TV)
configuration?.fireboltendpointstring(optional) A URL that specifies access point to Firebolt Riple. Should include session id in the query
configuration?.advertisingidobject(optional) Configure Identifier For Advertising
configuration?.advertisingid?.ifastring(optional) Advertising ID or IFA
configuration?.advertisingid?.lmtstring(optional) Limit advertising tracking, treated as boolean
configuration?.sbmainargsarray(optional) A list of additional arguments to pass to StarboardMain
configuration?.sbmainargs[#]string(optional)

Interfaces

This plugin implements the following interfaces:

Methods

The following methods are provided by the Cobalt plugin:

Cobalt interface methods:

MethodDescription
deeplinkSends a deep link to the application

deeplink method

Sends a deep link to the application.

Events

No Events.

Parameters

NameTypeDescription
paramsstringAn application-specific link

Result

NameTypeDescription
resultnull

Example

Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "Cobalt.1.deeplink",
    "params": "..."
}

Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": null
}

Properties

The following properties are provided by the Cobalt plugin:

StateControl interface properties:

PropertyDescription
stateRunning state of the service

Accessibility interface properties:

PropertyDescription
accessibilityAccessibility settings

state property

Provides access to the running state of the service.

Description

Use this property to return the running state of the service.

Events

EventDescription
statechangeTriggered if the state of the service changed.

Also see: statechange

Value

NameTypeDescription
(property)stringRunning state of the service (must be one of the following: resumed, suspended)

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "Cobalt.1.state"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": "resumed"
}

Set Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "Cobalt.1.state",
    "params": "resumed"
}

Set Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": "null"
}

accessibility property

Provides access to the accessibility settings.

Value

NameTypeDescription
(property)objectAccessibility settings
(property)?.closedcaptionsobject(optional) The platform settings for closed captions
(property)?.closedcaptions.isenabledbooleanDetermines if the user has chosen to enable closed captions on their system
(property)?.closedcaptions?.backgroundcolorstring(optional) The closed captioning color. (must be one of the following: Blue, Black, Cyan, Green, Magenta, Red, White, Yellow)
(property)?.closedcaptions?.backgroundopacitystring(optional) The closed captioning opacity percentages. (must be one of the following: 0, 25, 50, 75, 100)
(property)?.closedcaptions?.characteredgestylestring(optional) The closed captioning character edge style. (must be one of the following: None, Raised, Depressed, Uniform, DropShadow)
(property)?.closedcaptions?.fontcolorstring(optional) The closed captioning color. (must be one of the following: Blue, Black, Cyan, Green, Magenta, Red, White, Yellow)
(property)?.closedcaptions?.fontfamilystring(optional) The closed captioning font family. (must be one of the following: Casual, Cursive, MonospaceSansSerif, MonospaceSerif, ProportionalSansSerif, ProportionalSerif, SmallCapitals)
(property)?.closedcaptions?.fontopacitystring(optional) The closed captioning opacity percentages. (must be one of the following: 0, 25, 50, 75, 100)
(property)?.closedcaptions?.fontsizestring(optional) The closed captioning font size percentages. (must be one of the following: 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300)
(property)?.closedcaptions?.windowcolorstring(optional) The closed captioning color. (must be one of the following: Blue, Black, Cyan, Green, Magenta, Red, White, Yellow)
(property)?.closedcaptions?.windowopacitystring(optional) The closed captioning opacity percentages. (must be one of the following: 0, 25, 50, 75, 100)
(property)?.textdisplayobject(optional) Text display settings
(property)?.textdisplay.ishighcontrasttextenabledbooleanWhether the high contrast text setting is enabled or not

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "Cobalt.1.accessibility"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": {
        "closedcaptions": {
            "isenabled": false,
            "backgroundcolor": "Blue",
            "backgroundopacity": "0",
            "characteredgestyle": "None",
            "fontcolor": "Blue",
            "fontfamily": "Casual",
            "fontopacity": "0",
            "fontsize": "25",
            "windowcolor": "Blue",
            "windowopacity": "0"
        },
        "textdisplay": {
            "ishighcontrasttextenabled": false
        }
    }
}

Set Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "Cobalt.1.accessibility",
    "params": {
        "closedcaptions": {
            "isenabled": false,
            "backgroundcolor": "Blue",
            "backgroundopacity": "0",
            "characteredgestyle": "None",
            "fontcolor": "Blue",
            "fontfamily": "Casual",
            "fontopacity": "0",
            "fontsize": "25",
            "windowcolor": "Blue",
            "windowopacity": "0"
        },
        "textdisplay": {
            "ishighcontrasttextenabled": false
        }
    }
}

Set Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": "null"
}

Notifications

Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [Thunder] for information on how to register for a notification.

The following events are provided by the Cobalt plugin:

Cobalt interface events:

EventDescription
closureTriggered when the application requests to close its window

StateControl interface events:

EventDescription
statechangeSignals a state change of the service

closure event

Triggered when the application requests to close its window.

Parameters

This event carries no parameters.

Example

{
    "jsonrpc": "2.0",
    "method": "client.events.1.closure"
}

statechange event

Signals a state change of the service.

Parameters

NameTypeDescription
paramsobject
params.suspendedbooleanDetermines if the service has entered suspended state (true) or resumed state (false)

Example

{
    "jsonrpc": "2.0",
    "method": "client.events.1.statechange",
    "params": {
        "suspended": false
    }
}