Difference between revisions of "Tips & Tricks"

From MSX - Wiki
Jump to navigation Jump to search
Line 127: Line 127:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|
 
|
The <code>{APP_ID}</code> part must be replaced with a Samsung-specific application identifier (e.g. <code>system:samsung:launch:com.example.app</code>).
+
The <code>{APP_ID}</code> part must be replaced with a Samsung-specific application identifier (e.g. <code>system:samsung:launch:exampleApp</code>).
 
|-
 
|-
 
|
 
|
Line 147: Line 147:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|
 
|
The <code>{APP_ID}</code> part must be replaced with a Tizen-specific application identifier (e.g. <code>system:tizen:launch:com.example.app</code>).
+
The <code>{APP_ID}</code> part must be replaced with a Tizen-specific application identifier (e.g. <code>system:tizen:launch:examplePackage.exampleApp</code>).
  
 
The <code>{OPERATION}</code> part must be replaced with a Tizen-specific operation (e.g. <code>http://tizen.org/appcontrol/operation/view</code>).
 
The <code>{OPERATION}</code> part must be replaced with a Tizen-specific operation (e.g. <code>http://tizen.org/appcontrol/operation/view</code>).

Revision as of 11:31, 17 September 2021

Distributed Versions[edit]

Distributed versions were mainly developed for legacy/outdated TV devices that no longer have an official support. However, they can also be used to test the latest features before the official version is released in stores. Please note that these versions differ from official versions in downloading all scripts and styles from the web. Therefore, the application version is always up-to-date. However, the package version can change over time (e.g. to activate required platform features in the manifest file). Therefore, these versions are only recommended for experts who know how to install and use them.

Note: Please note that HTTPS connections often cause problems on legacy/outdated devices. Therefore, services that require HTTPS connections (like Google Drive MSX) will not work on these devices.

Distributed versions
Platform Supported Devices Required Framework/OS Version Current Package Version Package Link Remarks
Samsung TVs (Legacy) 2011-2014 models WebApi 1.0+ dist5 https://msx.benzac.de/dist/samsung.zip -
Samsung TVs (Outdated) 2015-2016 models Tizen 2.3+ dist6 https://msx.benzac.de/dist/tizen.wgt Same package as for 2017+ models
Samsung TVs (Current) 2017+ models Tizen 2.3+ dist6 https://msx.benzac.de/dist/tizen.wgt Same package as for 2015-2016 models
LG TVs (Legacy) 2011-2014 models NetCast 2.0+ dist3 https://msx.benzac.de/dist/netcast.zip -
LG TVs (Current) 2014+ models webOS 1.0+ dist7 https://msx.benzac.de/dist/lg.ipk -

For official versions, please visit: https://msx.benzac.de/info/?tab=PlatformSupport.

Alternatively, you can try to use the #Web Version Loader service.

Web Version Loader[edit]

If you have an older version of Media Station X, you can use the web version loader service to load the latest version from the web. Additionally, this service allows you to load the entire Media Station X application in a secure context (i.e. via https://) to be able to use services like Twitch MSX. Enter the start parameter web.msx.benzac.de to set it up.

For more information about the Twitch MSX service, please visit: https://msx.benzac.de/info/?tab=Showcases&section=Showcase7.

Screenshot[edit]

Web Version Loader

Google Drive MSX[edit]

Please note that the Google Drive API currently does not support a proper way of streaming files. Therefore, the entire file must be downloaded into the memory. Some TV devices have problems with this (especially if the file is too large and/or if the file is a video/audio file) and will abort the process. There are two ways to fix this problem.

  1. If the video/audio file is smaller than 100 MB, share the file (or the containing folder) publicly and let the file (or folder) name start with "export" (e.g. "export", "export.mp4", "export_My_Video.mp4", etc.). This will cause the Google Drive MSX service to open the file via the export link. Because export links are streamed, it should work with every TV device.
  2. You can use the OneDrive MSX or Dropbox MSX service for video/audio files, because these services have functions for streaming content.

For more information about the Google Drive MSX, OneDrive MSX, and Dropbox MSX service, please visit: https://msx.benzac.de/info/?tab=Showcases&section=Showcase2.

Screenshot[edit]

Google Drive MSX (Export Feature)

Node Browser MSX[edit]

It is possible to use the Node Browser MSX service with other HTTP servers (instead of Node.js). To do so, you simply have to enable the directory listing function and CORS on the used server. For example, by using the following .htaccess file.

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Origin, Content-Type, Accept"
Header set Access-Control-Allow-Methods "GET, OPTIONS"
Options +Indexes

If the browser folder should not be the root folder, you can initiate a redirect in the loaded index file with the help of an HTML meta tag. Please see this example code of a redirected browser folder.

<!DOCTYPE html>
<html>
    <head>
        <title>Node Browser Test</title>
        <meta charset="UTF-8"/>
        <meta name="node-browser-folder" content="path/to/folder"/>
    </head>
    <body>
        <h1>Node Browser Test</h1>
    </body>
</html>

Note: Please note that the CORS HTTP headers must also be present for the loaded index file.

For more information about the Node Browser MSX service, please visit: https://msx.benzac.de/info/?tab=Showcases&section=Showcase5.

External HTML5 Games/Apps[edit]

It is possible to open external HTML5 games or apps with the link:{URL} action. However, in most cases you will not be able to return to the Media Station X application due to the lack of an exit function in the loaded game/app. The only way out in this case is to exit and restart the entire application. For this reason, the link validation is enabled by default in the Media Station X settings (SettingsValidate Links).

If you would like to open your own HTML5 game or app from the Media Station X application, you should also include an exit button in your game/app to give users the chance to return to the Media Station X application. For example, this can be done by using the following JavaScript function.

function exitToRootApp() {
    window.history.go(1 - window.history.length);
}

For external portal/playlist apps that also support opening links, you can add the following entry: http://msx.benzac.de/exit.html. This link does nothing more than executing the exitToRootApp function described above.

External Platform Games/Apps[edit]

It is possible to launch external games or apps (which are installed on the current platform) with the system:{PLATFORM}:launch or system:{PLATFORM}:launch:{APP_ID} action. Please note that the syntax for launching external games/apps is different for each platform. Please see following examples.

Examples of launching external platform games/apps
Action Example Remarks
{
    "action": "system:hbbtv:launch:{APP_ID}"
}

The {APP_ID} part must be replaced with an HbbTV-compatible URL (e.g. system:hbbtv:launch:http://msx.benzac.de/hbbtv.html).

{
    "action": "system:lg:launch:{APP_ID}",
    "data": {
        "properties": {
            "customKey1": "customValue1",
            "customKey2": "customValue2" 
        }
    }
}

The {APP_ID} part must be replaced with an LG-specific application identifier (e.g. system:lg:launch:com.example.app).

{
    "action": "system:samsung:launch:{APP_ID}"
}

The {APP_ID} part must be replaced with a Samsung-specific application identifier (e.g. system:samsung:launch:exampleApp).

{
    "action": "system:tizen:launch:{APP_ID}",
    "data": {        
        "operation": "{OPERATION}",
        "uri": "{URI}",
        "type": "{MIME_TYPE}",
        "category": "{CATEGORY}",
        "mode": "{MODE}",
        "properties": {
            "customKey1": "customValue1",
            "customKey2": "customValue2" 
        }
    }
}

The {APP_ID} part must be replaced with a Tizen-specific application identifier (e.g. system:tizen:launch:examplePackage.exampleApp).

The {OPERATION} part must be replaced with a Tizen-specific operation (e.g. http://tizen.org/appcontrol/operation/view).

The {URI} part must be replaced with an action-specific URI (e.g. http://link.to.media).

The {MIME_TYPE} part must be replaced with an action-specific mime type (e.g. video/*).

The {CATEGORY} part must be replaced with a Tizen-specific category (e.g. video).

The {MODE} part must be replaced with a Tizen-specific launch mode (i.e. SINGLE or GROUP).

Note: It is also possible to omit the {APP_ID} part in order to perform an implicit launch (e.g. system:tizen:launch).

{
    "action": "system:tvx:launch:{APP_ID}",
    "data": {
        "id": "{REQUEST_ID}",
        "uri": "{URI}",
        "type": "{MIME_TYPE}",
        "component": {
            "package": "{PACKAGE}",
            "class": "{CLASS}"
        },
        "extra": {
            "customKey1": "customValue1",
            "customKey2": "customValue2" 
        }
    }
}

For iOS devices, the {APP_ID} part must be replaced with an iOS-specific URL (e.g. system:tvx:launch:example://http://link.to.media).

For Android devices, the {APP_ID} part must be replaced with an Android-specific package name (e.g. system:tvx:launch:com.example.app).

The {REQUEST_ID} part must be replaced with a custom request ID (e.g. request_id).

For Android devices, the {URI} part must be replaced with an action-specific URI (e.g. http://link.to.media).

For Android devices, the {MIME_TYPE} part must be replaced with an action-specific mime type (e.g. video/*).

For Android devices, the {PACKAGE} part must be replaced with an Android-specific package name (e.g. com.example.app).

For Android devices, the {CLASS} part must be replaced with an Android-specific class name (e.g. com.example.app.player).

Note: For Android devices, it is also possible to omit the {APP_ID} part in order to perform an implicit launch (e.g. system:tvx:launch).

{
    "action": "system:uwp:launch:{APP_ID}"
}

The {APP_ID} part must be replaced with any URL (e.g. system:uwp:launch:http://msx.benzac.de).

Unique Device ID[edit]

It is tricky to get a unique device ID for every platform, because some platforms do not provide such kind of information. Please see the Attached Data Examples (specifically, execute:info:extended:{URL}). It shows which information can be read out from the Media Station X application. The information under info.system contains platform-specific data and can contain a macAddress or deviceId, which can be used as unique device ID. If this information is missing, the platform does not provide a unique device ID und you have to create and store your own.

If you are implementing a video/audio or interaction plugin, you can use the getDeviceId(data) or requestDeviceId(callback) function, which returns a unique device ID based on the information provided by the platform. Please see Plugin API Reference for more information.

Launcher MSX[edit]

It is possible to add a launcher object (that can contain an icon, image, and/or color property) to the Start Object to change the appearance of the start parameter item in the Launcher MSX service. Please see following example code.

{
    "name": "SoundCloud® MSX",
    "version": "1.0.14",
    "parameter": "menu:user:{PREFIX}{SERVER}/msx/service.php",
    "launcher": {
        "icon": "music-note",
        "image": "none",
        "color": "#f75219"
    }
}

It is also possible to override the name, version, and/or parameter property inside the launcher object to use different values for the Launcher MSX service. The parameter property inside the launcher object can also contain a link:{URL} action. Please see following example code.

{
    "name": "Twitch MSX",
    "version": "1.0.5",
    "parameter": "menu:request:interaction:init@{PREFIX}{SERVER}/interaction",
    "launcher": {
        "parameter": "link:https://msx.benzac.de/?start=menu:request:interaction:init@{PREFIX}{SERVER}/interaction&leave=1",
        "icon": "videogame-asset",
        "image": "none",
        "color": "#8c45f7"
    }
}

For more information about the Launcher MSX service, please visit: https://msx.benzac.de/info/?tab=Showcases&section=Showcase9.

Screenshot[edit]

Launcher MSX