Difference between revisions of "Background Plugin"

From MSX - Wiki
Jump to navigation Jump to search
 
(23 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
== Usage ==
 
== Usage ==
The plugin must be loaded with a video URL. Please see following action syntax example.
+
The plugin can be loaded with a video URL or ID. If a video ID is used, the interaction plugin is used to request the corresponding URL. Please see following action syntax examples.
  
 
* <code>video:plugin:http://msx.benzac.de/plugins/background.html?url={URL}</code>
 
* <code>video:plugin:http://msx.benzac.de/plugins/background.html?url={URL}</code>
 +
* <code>video:plugin:http://msx.benzac.de/plugins/background.html?id={ID}</code>
 +
 +
If you would like to use the plugin with Google Drive MSX, OneDrive MSX, or Dropbox MSX, please use the <code>index.json</code> file feature and reference all video files with the inline expression <code>{asset:id:{NAME}}</code> (e.g. <code>{asset:id:video1.mp4}</code>). For more information, please see '''Credits & Hints''' from the corresponding service.
 +
 +
'''Note: For Google Drive MSX, all referenced files must be publicly shared and smaller than 100 MB.'''
  
 
If you would like to use the plugin as reference to implement your own plugin, please have a look at this implementation script: http://msx.benzac.de/plugins/js/background.js.
 
If you would like to use the plugin as reference to implement your own plugin, please have a look at this implementation script: http://msx.benzac.de/plugins/js/background.js.
Line 10: Line 15:
 
== Syntax ==
 
== Syntax ==
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
|+ Parameter syntax of panorama plugin
+
|+ Parameter syntax of background plugin
 
|-
 
|-
 
! Parameter !! Type !! Default Value !! Mandatory !! class="unsortable" | Description  
 
! Parameter !! Type !! Default Value !! Mandatory !! class="unsortable" | Description  
 
|-
 
|-
| <code>url</code> || <code>string</code> || <code>null</code> || '''Yes''' ||
+
| <code>id</code> || <code>string</code> || <code>null</code> || No ||
 +
The ID of the background video. This ID is used to request the corresponding URL from the interaction plugin.
 +
|-
 +
| <code>url</code> || <code>string</code> || <code>null</code> || '''Only if video ID is not set''' ||
 
The URL of the background video. It is recommended to encode the value to ensure that it is evaluated correctly (e.g. <code>"http://msx.benzac.de/media/atmos1.mp4"</code> → <code>"http%3A%2F%2Fmsx.benzac.de%2Fmedia%2Fatmos1.mp4"</code>).
 
The URL of the background video. It is recommended to encode the value to ensure that it is evaluated correctly (e.g. <code>"http://msx.benzac.de/media/atmos1.mp4"</code> → <code>"http%3A%2F%2Fmsx.benzac.de%2Fmedia%2Fatmos1.mp4"</code>).
 
|}
 
|}
  
 
== Example ==
 
== Example ==
Please note that in this example some properties are used that are only available in version '''0.1.142''' or higher.
+
Please note that this example uses some properties that are only available in version '''0.1.142''' or higher. Please also note that the service http://msx.benzac.de/services/background.php is not part of the plugin. It is just a helper service to return a background video plugin action if no other video/audio is running.
 
=== Screenshot ===
 
=== Screenshot ===
 
[[File:background_plugin.png|thumb|640px|none|Example Screenshot (Background Plugin)]]
 
[[File:background_plugin.png|thumb|640px|none|Example Screenshot (Background Plugin)]]
Line 27: Line 35:
 
{
 
{
 
     "headline": "Background Plugin Test",
 
     "headline": "Background Plugin Test",
     "style": "flat",
+
     "style": "overlay",
 
     "transparent": 2,
 
     "transparent": 2,
 
     "ready": {
 
     "ready": {
         "action": "video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos1.mp4",
+
         "action": "execute:service:video:data:http://msx.benzac.de/services/background.php",
 
         "data": {
 
         "data": {
             "playerLabel": "Atmospheric Background 1",
+
             "url": "http://msx.benzac.de/media/atmos1.mp4",
             "properties": {
+
             "label": "Atmospheric Background 1",
                "control:type": "extended",
+
            "transparent": true
                "control:reuse": "continue",
 
                "control:transparent": true
 
            }
 
 
         }
 
         }
 
     },
 
     },
 
     "menu": [{
 
     "menu": [{
 
             "label": "Menu Item 1",
 
             "label": "Menu Item 1",
             "data": {
+
             "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
                "pages": [{
 
                        "items": [{
 
                                "layout": "0,0,12,6",
 
                                "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 1}.",
 
                                "action": "video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos1.mp4",
 
                                "playerLabel": "Atmospheric Background 1",
 
                                "properties": {
 
                                    "control:type": "extended",
 
                                    "control:reuse": "restart",
 
                                    "control:transparent": true
 
                                }
 
                            }]
 
                    }]
 
            }
 
 
         }, {
 
         }, {
 
             "label": "Menu Item 2",
 
             "label": "Menu Item 2",
             "data": {
+
             "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
                "pages": [{
 
                        "items": [{
 
                                "layout": "0,0,12,6",
 
                                "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 2}.",
 
                                "action": "video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos2.mp4",
 
                                "playerLabel": "Atmospheric Background 2",
 
                                "properties": {
 
                                    "control:type": "extended",
 
                                    "control:reuse": "restart",
 
                                    "control:transparent": true
 
                                }
 
                            }]
 
                    }]
 
            }
 
 
         }, {
 
         }, {
 
             "label": "Menu Item 3",
 
             "label": "Menu Item 3",
             "data": {
+
             "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
                "pages": [{
 
                        "items": [{
 
                                "layout": "0,0,12,6",
 
                                "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 3}.",
 
                                "action": "video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos3.mp4",
 
                                "playerLabel": "Atmospheric Background 3",
 
                                "properties": {
 
                                    "control:type": "extended",
 
                                    "control:reuse": "restart",
 
                                    "control:transparent": false
 
                                }
 
                            }]
 
                    }]
 
            }
 
 
         }, {
 
         }, {
 
             "label": "Menu Item 4",
 
             "label": "Menu Item 4",
             "data": {
+
             "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
                "pages": [{
 
                        "items": [{
 
                                "layout": "0,0,12,6",
 
                                "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 4}.",
 
                                "action": "video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos4.mp4",
 
                                "playerLabel": "Atmospheric Background 4",
 
                                "properties": {
 
                                    "control:type": "extended",
 
                                    "control:reuse": "restart",
 
                                    "control:transparent": true
 
                                }
 
                            }]
 
                    }]
 
            }
 
 
         }, {
 
         }, {
 
             "label": "Menu Item 5",
 
             "label": "Menu Item 5",
             "data": {
+
             "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
                "pages": [{
+
        }, {
                        "items": [{
+
            "label": "Menu Item 6",
                                "layout": "0,0,12,6",
+
            "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
                                "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 5}.",
 
                                "action": "video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos5.mp4",
 
                                "playerLabel": "Atmospheric Background 5",
 
                                "properties": {
 
                                    "control:type": "extended",
 
                                    "control:reuse": "restart",
 
                                    "control:transparent": false
 
                                }
 
                            }]
 
                    }]
 
            }
 
 
         }]
 
         }]
 
}
 
}
Line 130: Line 68:
  
 
=== Demo ===
 
=== Demo ===
* Launch via App: https://msx.benzac.de/?start=menu:https://msx.benzac.de/info/xp/data/plugin_test_6.json
+
* Launch via App: https://msx.benzac.de/?start=menu:https://msx.benzac.de/info/xp/data/plugin_test_6_menu.json
* Launch via Demo Page: https://msx.benzac.de/info/?start=menu:https://msx.benzac.de/info/xp/data/plugin_test_6.json
+
* Launch via Demo Page: https://msx.benzac.de/info/?start=menu:https://msx.benzac.de/info/xp/data/plugin_test_6_menu.json
  
 
== See also ==
 
== See also ==
 
* [[Video/Audio Plugin]]
 
* [[Video/Audio Plugin]]
* [[Interaction Plugin]]
 
* [[Image Plugin]]
 
* [[HTML5X Plugin]]
 
* [[Panorama Plugin]]
 
 
* [[Plugin API Reference]]
 
* [[Plugin API Reference]]

Latest revision as of 12:06, 12 June 2023

This is a special video plugin that plays a video in an endless loop. The plugin can be used with version 0.1.74 or higher.

Usage[edit]

The plugin can be loaded with a video URL or ID. If a video ID is used, the interaction plugin is used to request the corresponding URL. Please see following action syntax examples.

If you would like to use the plugin with Google Drive MSX, OneDrive MSX, or Dropbox MSX, please use the index.json file feature and reference all video files with the inline expression {asset:id:{NAME}} (e.g. {asset:id:video1.mp4}). For more information, please see Credits & Hints from the corresponding service.

Note: For Google Drive MSX, all referenced files must be publicly shared and smaller than 100 MB.

If you would like to use the plugin as reference to implement your own plugin, please have a look at this implementation script: http://msx.benzac.de/plugins/js/background.js.

Syntax[edit]

Parameter syntax of background plugin
Parameter Type Default Value Mandatory Description
id string null No

The ID of the background video. This ID is used to request the corresponding URL from the interaction plugin.

url string null Only if video ID is not set

The URL of the background video. It is recommended to encode the value to ensure that it is evaluated correctly (e.g. "http://msx.benzac.de/media/atmos1.mp4""http%3A%2F%2Fmsx.benzac.de%2Fmedia%2Fatmos1.mp4").

Example[edit]

Please note that this example uses some properties that are only available in version 0.1.142 or higher. Please also note that the service http://msx.benzac.de/services/background.php is not part of the plugin. It is just a helper service to return a background video plugin action if no other video/audio is running.

Screenshot[edit]

Example Screenshot (Background Plugin)

Code[edit]

{
    "headline": "Background Plugin Test",
    "style": "overlay",
    "transparent": 2,
    "ready": {
        "action": "execute:service:video:data:http://msx.benzac.de/services/background.php",
        "data": {
            "url": "http://msx.benzac.de/media/atmos1.mp4",
            "label": "Atmospheric Background 1",
            "transparent": true
        }
    },
    "menu": [{
            "label": "Menu Item 1",
            "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
        }, {
            "label": "Menu Item 2",
            "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
        }, {
            "label": "Menu Item 3",
            "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
        }, {
            "label": "Menu Item 4",
            "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
        }, {
            "label": "Menu Item 5",
            "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
        }, {
            "label": "Menu Item 6",
            "data": "http://msx.benzac.de/info/xp/data/plugin_test_6_content.json"
        }]
}

Demo[edit]

See also[edit]