Difference between revisions of "Android Player"

From MSX - Wiki
Jump to navigation Jump to search
Line 39: Line 39:
 
                 "type": "byte",
 
                 "type": "byte",
 
                 "value": 1
 
                 "value": 1
             },
+
             },          
            "extra_char": {
 
                "type": "char",
 
                "value": 1
 
            },
 
 
             "extra_short": {
 
             "extra_short": {
 
                 "type": "short",
 
                 "type": "short",
Line 75: Line 71:
 
                 "type": "byte",
 
                 "type": "byte",
 
                 "values": [1, 2, 3]
 
                 "values": [1, 2, 3]
             },
+
             },          
            "extra_char_array": {
 
                "type": "char",
 
                "values": [1, 2, 3]
 
            },
 
 
             "extra_short_array": {
 
             "extra_short_array": {
 
                 "type": "short",
 
                 "type": "short",

Revision as of 14:49, 5 May 2021

It is possible to launch an external Android player (VLC, MX Player & Co.) via a system action (system:tvx:launch or system:tvx:launch:{APP_ID}) and to handle the results (e.g. the last video/audio position) via an application event (app:result). This API is available in Media Station X version 0.1.136 or higher for all Android and FireTV devices.

Syntax[edit]

{
    "action": "system:tvx:launch:com.example.app",
    "data": {
        "id": "request_id",
        "uri": "http://link.to.video",
        "type": "video/*",
        "component": {
            "package": "com.example.app",
            "class": "com.example.app.player"
        },
        "extra": {
            "extra_string": "Value",        
            "extra_boolean": true,
            "extra_int": 1,
            "extra_long": 1234567890123,
            "extra_double": 1.1,
            "extra_string_array": ["Value 1", "Value 2", "Value 3"],
            "extra_boolean_array": [true, false, true],
            "extra_int_array": [1, 2, 3],
            "extra_long_array": [1234567890123, 1234567890123, 1234567890123],
            "extra_double_array": [1.1, 2.2, 3.3],        
            "extra_uri": {
                "type": "uri",
                "value": "http://link.to.asset"
            },
            "extra_string_alt": {
                "type": "string",
                "value": "Value"
            },        
            "extra_boolean_alt": {
                "type": "boolean",
                "value": true
            },
            "extra_byte": {
                "type": "byte",
                "value": 1
            },           
            "extra_short": {
                "type": "short",
                "value": 1
            },            
            "extra_int_alt": {
                "type": "int",
                "value": 1
            },
            "extra_long_alt": {
                "type": "long",
                "value": 1234567890123
            },
            "extra_float": {
                "type": "float",
                "value": 1.1
            },
            "extra_double_alt": {
                "type": "double",
                "value": 1.1
            },
            "extra_string_array_alt": {
                "type": "string",
                "values": ["Value 1", "Value 2", "Value 3"]
            },
            "extra_boolean_array_alt": {
                "type": "boolean",
                "values": [true, false, true]
            },
            "extra_byte_array": {
                "type": "byte",
                "values": [1, 2, 3]
            },           
            "extra_short_array": {
                "type": "short",
                "values": [1, 2, 3]
            },
            "extra_int_array_alt": {
                "type": "int",
                "values": [1, 2, 3]
            },
            "extra_long_array_alt": {
                "type": "long",
                "values": [1234567890123, 1234567890123, 1234567890123]
            },
            "extra_float_array": {
                "type": "float",
                "values": [1.1, 2.2, 3.3]
            },
            "extra_double_array_alt": {
                "type": "double",
                "values": [1.1, 2.2, 3.3]     
            },
            "extra_uri_array": {
                "type": "uri",
                "values": ["http://link.to.asset1", "http://link.to.asset2", "http://link.to.asset3"]
            },
            "extra_string_list": {
                "type": "list:string",
                "values": ["Value 1", "Value 2", "Value 3"]
            },
            "extra_int_list": {
                "type": "list:int",
                "values": [1, 2, 3]
            },
            "extra_uri_list": {
                "type": "list:uri",
                "values": ["http://link.to.asset1", "http://link.to.asset2", "http://link.to.asset3"]
            }
        }
    }
}
Property syntax of additional launch data
Property Type Default Value Mandatory Since Version Description
id string null No 0.1.136

The request ID.

uri string null No 0.1.136

The data URI.

type string null No 0.1.136

The data type.

component object null No 0.1.136

The component that should be launched.

extra object null No 0.1.136

The extended data that is handled by the launched application.

Example[edit]

This example uses an interaction plugin to create the content and to handle the application events. Please have a look at this implementation script: https://msx.benzac.de/interaction/js/android.js.

Screenshot[edit]

Example Screenshot (Android Player)

Code[edit]

{
    "reference": "request:interaction:init@http://msx.benzac.de/interaction/android.html",
    "pages": []
}

Demo[edit]

Note: This demo will only work properly on a Android or FireTV device with Media Station X 0.1.136 or higher.