Difference between revisions of "Background Plugin"

From MSX - Wiki
Jump to navigation Jump to search
Line 30: Line 30:
 
     "transparent": 2,
 
     "transparent": 2,
 
     "ready": {
 
     "ready": {
         "action": "execute:fetch:http://msx.benzac.de/services/background.php?url=http://msx.benzac.de/media/atmos1.mp4&reuse=continue&transparent=true"
+
         "action": "video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos1.mp4",
 +
        "data": {
 +
            "playerLabel": "Atmospheric Background 1",
 +
            "properties": {
 +
                "control:type": "extended",
 +
                "control:reuse": "continue",
 +
                "control:transparent": true,
 +
                "label:duration": "{ico:repeat} {VALUE}"
 +
            }
 +
        }
 
     },
 
     },
 
     "menu": [{
 
     "menu": [{
Line 39: Line 48:
 
                                 "layout": "0,0,12,6",
 
                                 "layout": "0,0,12,6",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 1}.",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 1}.",
                                 "action": "execute:fetch:http://msx.benzac.de/services/background.php?url=http://msx.benzac.de/media/atmos1.mp4&reuse=restart&transparent=true"
+
                                 "action": "[video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos1.mp4]",
 +
                                "data": {
 +
                                    "playerLabel": "Atmospheric Background 1",
 +
                                    "properties": {
 +
                                        "control:type": "extended",
 +
                                        "control:reuse": "restart",
 +
                                        "control:transparent": true,
 +
                                        "label:duration": "{ico:repeat} {VALUE}"
 +
                                    }
 +
                                }
 
                             }]
 
                             }]
 
                     }]
 
                     }]
Line 50: Line 68:
 
                                 "layout": "0,0,12,6",
 
                                 "layout": "0,0,12,6",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 2}.",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 2}.",
                                 "action": "execute:fetch:http://msx.benzac.de/services/background.php?url=http://msx.benzac.de/media/atmos2.mp4&reuse=restart&transparent=true"
+
                                 "action": "[video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos2.mp4]",
 +
                                "data": {
 +
                                    "playerLabel": "Atmospheric Background 2",
 +
                                    "properties": {
 +
                                        "control:type": "extended",
 +
                                        "control:reuse": "restart",
 +
                                        "control:transparent": true,
 +
                                        "label:duration": "{ico:repeat} {VALUE}"
 +
                                    }
 +
                                }
 
                             }]
 
                             }]
 
                     }]
 
                     }]
Line 61: Line 88:
 
                                 "layout": "0,0,12,6",
 
                                 "layout": "0,0,12,6",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 3}.",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 3}.",
                                 "action": "execute:fetch:http://msx.benzac.de/services/background.php?url=http://msx.benzac.de/media/atmos3.mp4&reuse=restart&transparent=false"
+
                                 "action": "[video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos3.mp4]",
 +
                                "data": {
 +
                                    "playerLabel": "Atmospheric Background 3",
 +
                                    "properties": {
 +
                                        "control:type": "extended",
 +
                                        "control:reuse": "restart",
 +
                                        "control:transparent": false,
 +
                                        "label:duration": "{ico:repeat} {VALUE}"
 +
                                    }
 +
                                }
 
                             }]
 
                             }]
 
                     }]
 
                     }]
Line 72: Line 108:
 
                                 "layout": "0,0,12,6",
 
                                 "layout": "0,0,12,6",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 4}.",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 4}.",
                                 "action": "execute:fetch:http://msx.benzac.de/services/background.php?url=http://msx.benzac.de/media/atmos4.mp4&reuse=restart&transparent=true"
+
                                 "action": "[video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos4.mp4]",
 +
                                "data": {
 +
                                    "playerLabel": "Atmospheric Background 4",
 +
                                    "properties": {
 +
                                        "control:type": "extended",
 +
                                        "control:reuse": "restart",
 +
                                        "control:transparent": true,
 +
                                        "label:duration": "{ico:repeat} {VALUE}"
 +
                                    }
 +
                                }
 
                             }]
 
                             }]
 
                     }]
 
                     }]
Line 83: Line 128:
 
                                 "layout": "0,0,12,6",
 
                                 "layout": "0,0,12,6",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 5}.",
 
                                 "text": "Press {txt:msx-white:OK} to switch to {txt:msx-white:Atmospheric Background 5}.",
                                 "action": "execute:fetch:http://msx.benzac.de/services/background.php?url=http://msx.benzac.de/media/atmos5.mp4&reuse=restart&transparent=false"
+
                                 "action": "[video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos5.mp4]",
 +
                                "data": {
 +
                                    "playerLabel": "Atmospheric Background 5",
 +
                                    "properties": {
 +
                                        "control:type": "extended",
 +
                                        "control:reuse": "restart",
 +
                                        "control:transparent": false,
 +
                                        "label:duration": "{ico:repeat} {VALUE}"
 +
                                    }
 +
                                }
 
                             }]
 
                             }]
 
                     }]
 
                     }]

Revision as of 18:03, 13 November 2021

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 must be loaded with a video URL. Please see following action syntax example.

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
url string null Yes

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 in this example some properties are used that are only available in version 0.1.142 or higher.

Screenshot[edit]

Example Screenshot (Background Plugin)

Code[edit]

{
    "headline": "Background Plugin Test",
    "style": "flat",
    "transparent": 2,
    "ready": {
        "action": "video:auto:plugin:http://msx.benzac.de/plugins/background.html?url=http://msx.benzac.de/media/atmos1.mp4",
        "data": {
            "playerLabel": "Atmospheric Background 1",
            "properties": {
                "control:type": "extended",
                "control:reuse": "continue",
                "control:transparent": true,
                "label:duration": "{ico:repeat} {VALUE}"
            }
        }
    },
    "menu": [{
            "label": "Menu Item 1",
            "data": {
                "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]",
                                "data": {
                                    "playerLabel": "Atmospheric Background 1",
                                    "properties": {
                                        "control:type": "extended",
                                        "control:reuse": "restart",
                                        "control:transparent": true,
                                        "label:duration": "{ico:repeat} {VALUE}"
                                    }
                                }
                            }]
                    }]
            }
        }, {
            "label": "Menu Item 2",
            "data": {
                "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]",
                                "data": {
                                    "playerLabel": "Atmospheric Background 2",
                                    "properties": {
                                        "control:type": "extended",
                                        "control:reuse": "restart",
                                        "control:transparent": true,
                                        "label:duration": "{ico:repeat} {VALUE}"
                                    }
                                }
                            }]
                    }]
            }
        }, {
            "label": "Menu Item 3",
            "data": {
                "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]",
                                "data": {
                                    "playerLabel": "Atmospheric Background 3",
                                    "properties": {
                                        "control:type": "extended",
                                        "control:reuse": "restart",
                                        "control:transparent": false,
                                        "label:duration": "{ico:repeat} {VALUE}"
                                    }
                                }
                            }]
                    }]
            }
        }, {
            "label": "Menu Item 4",
            "data": {
                "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]",
                                "data": {
                                    "playerLabel": "Atmospheric Background 4",
                                    "properties": {
                                        "control:type": "extended",
                                        "control:reuse": "restart",
                                        "control:transparent": true,
                                        "label:duration": "{ico:repeat} {VALUE}"
                                    }
                                }
                            }]
                    }]
            }
        }, {
            "label": "Menu Item 5",
            "data": {
                "pages": [{
                        "items": [{
                                "layout": "0,0,12,6",
                                "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]",
                                "data": {
                                    "playerLabel": "Atmospheric Background 5",
                                    "properties": {
                                        "control:type": "extended",
                                        "control:reuse": "restart",
                                        "control:transparent": false,
                                        "label:duration": "{ico:repeat} {VALUE}"
                                    }
                                }
                            }]
                    }]
            }
        }]
}

Demo[edit]

See also[edit]