Extended Properties

From MSX - Wiki
Revision as of 19:19, 24 February 2021 by Benzac (talk | contribs) (→‎Syntax)
Jump to navigation Jump to search

These properties can be used for special use cases and are only valid for version 0.1.129+. Please ensure that you are using the correct version, because the syntax in previous versions can be different. Each property is a key-value pair of type string and can be set in the properties property of a Content Item Object. The dynamic properties can also be set via an action at runtime. For more information, please see Internal Actions.

Syntax[edit]

Property syntax of extended properties
Property Value Example Dynamic Description
button:{BUTTON_ID}:action {ACTION}

"button:content:action": "info:Custom content action executed."
"button:restart:action": "info:Custom restart action executed."
"button:prev:action": "info:Custom prev action executed."
"button:rewind:action": "info:Custom rewind action executed."
"button:play_pause:action": "info:Custom play/pauseaction executed."
"button:forward:action": "info:Custom forward action executed."
"button:next:action": "info:Custom next action executed."
"button:speed:action": "info:Custom speed action executed."

Yes

Sets up a custom player button action (all buttons except the eject button are supported). By default, the following actions are executed.

  • content: player:content
  • restart: player:restart
  • prev: player:prev
  • rewind: player:rewind
  • play_pause: player:play_pause
  • forward: player:forward
  • next: player:next
  • speed: player:speed

Note: To use this property, the corresponding button:{BUTTON_ID}:icon property must also be set, otherwise this property is ignored. For property actions, it is not possible to provide an action-related data property. If you want to execute a property data action, please use the execute:fetch:{URL} action, alternatively.

button:{BUTTON_ID}:display {BOOLEAN_VALUE}

"button:content:display": "true"
"button:restart:display": "true"
"button:prev:display": "true"
"button:rewind:display": "true"
"button:play_pause:display": "true"
"button:forward:display": "true"
"button:next:display": "true"
"button:speed:display": "true"

Yes

Shows/Hides a player button (all buttons except the eject button are supported).

button:{BUTTON_ID}:enable {BOOLEAN_VALUE}

"button:content:enable": "true"
"button:restart:enable": "true"
"button:prev:enable": "true"
"button:rewind:enable": "true"
"button:play_pause:enable": "true"
"button:forward:enable": "true"
"button:next:enable": "true"
"button:speed:enable": "true"

Yes

Enables/Disables a player button (all buttons except the eject button are supported).

button:{BUTTON_ID}:focus {BOOLEAN_VALUE}

"button:content:focus": "true"
"button:restart:focus": "true"
"button:prev:focus": "true"
"button:rewind:focus": "true"
"button:play_pause:focus": "true"
"button:forward:focus": "true"
"button:next:focus": "true"
"button:speed:focus": "true"
"button:eject:focus": "true"

Yes

Focuses a player button (if player is loaded).

button:{BUTTON_ID}:icon {ICON}

"button:content:icon": "pageview"
"button:restart:icon": "replay"
"button:prev:icon": "skip-previous"
"button:rewind:icon": "fast-rewind"
"button:play_pause:icon": "play-arrow"
"button:forward:icon": "fast-forward"
"button:next:icon": "skip-next"
"button:speed:icon": "slow-motion-video"

Yes

Sets up a custom player button icon (all buttons except the eject button are supported). By default, the following icons are used.

  • content: pageview
  • restart: replay
  • prev: skip-previous
  • rewind: fast-rewind
  • play_pause: play-arrow|pause
  • forward: fast-forward
  • next: skip-next
  • speed: slow-motion-video

Note: To use this property, the corresponding button:{BUTTON_ID}:action property must also be set, otherwise this property is ignored.

control:load {LOAD_MODE}

"control:load": "default"
"control:load": "silent"

No

Sets up the player control load mode. If the mode is set to "silent", the player is not shown if the video/audio file is loaded in auto mode (e.g. if the action player:auto:next is executed).

image:action {ACTION}

"image:action": "info:Custom image action executed."

No

Sets up a custom slideshow image action (replacement for the default slideshow image action). By default, the action slider:labels:play_pause is executed.

Note: For property actions, it is not possible to provide an action-related data property. If you want to execute a property data action, please use the execute:fetch:{URL} action, alternatively.

image:extension {LABEL}

"image:extension": "Custom image extension label"

No

Sets up an additional slideshow image extension label (displayed in the slideshow labels).

image:trigger {ACTION}

"image:trigger": "info:Image is visible."

No

Sets up a slideshow image trigger.

Note: For property actions, it is not possible to provide an action-related data property. If you want to execute a property data action, please use the execute:fetch:{URL} action, alternatively.

label:duration {LABEL}

"label:duration": "Custom duration label"
"label:duration": "default"

Yes

Sets up the player duration label (overrides the default duration value of the video/audio player with a custom value).

label:extension {LABEL}

"label:extension": "{ico:live-tv}"
"label:extension": "default"

Yes

Sets up an additional player extension label.

label:position {LABEL}

"label:position": "Custom position label"
"label:position": "default"

Yes

Sets up the player position label (overrides the default position value of the video/audio player with a custom value).

progress:color {COLOR}

"progress:color": "msx-red"
"progress:color": "default"

Yes

Sets up the player progress color.

progress:marker:enable {BOOLEAN_VALUE}

"progress:marker:enable": "true"
"progress:marker:enable": "false"

Yes

Enables/Disables the player progress marker.

progress:type {PROGRESS_TYPE}

"progress:type": "position"
"progress:type": "position:{POSITION} {ico:image}"
"progress:type": "number"
"progress:type": "number:{NUMBER} {ico:image}"
"progress:type": "percentage"
"progress:type": "time:{LIVE_DURATION_FORMAT}"
"progress:type": "text:{LIVE_DURATION_TEXT}"
"progress:type": "reverse:position"
"progress:type": "reverse:position:{POSITION} {ico:image}"
"progress:type": "reverse:number"
"progress:type": "reverse:number:{NUMBER} {ico:image}"
"progress:type": "reverse:percentage"
"progress:type": "reverse:time:{LIVE_DURATION_FORMAT}"
"progress:type": "reverse:text:{LIVE_DURATION_TEXT}"
"progress:type": "difference:position"
"progress:type": "difference:position:{POSITION} {ico:image}"
"progress:type": "difference:number"
"progress:type": "difference:number:{NUMBER} {ico:image}"
"progress:type": "difference:percentage"
"progress:type": "difference:time:{LIVE_DURATION_FORMAT}"
"progress:type": "difference:text:{LIVE_DURATION_TEXT}"
"progress:type": "fix:Fix progress label"
"progress:type": "default"

Yes

Sets up the player progress type (default is like time:hh:mm:ss). For the type that starts with (or contains) position:, the {POSITION} part is automatically replaced with the corresponding position value. For the type that starts with (or contains) number:, the {NUMBER} part is automatically replaced with the corresponding number value (which is the incremented position value).

resume:key {RESUME_KEY}

"resume:key": "id"
"resume:key": "url"
"resume:key": "custom_resume_key"

No

Sets up a resume key to store/restore the content position. If the key is set to "id", the corresponding content item ID is used as key. If the key is set to "url", the corresponding content video/audio URL is used as key. In all other cases, the key is used as is.

Note: The key is stored as hash code on the local device. Stored keys can be cleared with the resume:clear actions.

resume:position {RESUME_POSITION}

"resume:position": "10"
"resume:position": "10%"

Yes

Sets up a fix resume position in seconds or percentage to start the content from there.

trigger:{TRIGGER_KEY} {ACTION}

"trigger:load": "info:Video loaded."
"trigger:ready": "info:Video ready."
"trigger:start": "info:Video started."
"trigger:end": "info:Video ended."
"trigger:complete": "info:Video completed."
"trigger:10": "info:10 seconds of video passed."
"trigger:10%": "info:10% of video passed."
"trigger:10t": "info:10 ticks of video passed."
"trigger:20": "shot:info:20 seconds of video passed (shot)."
"trigger:20%": "shot:info:20% of video passed (shot)."
"trigger:20t": "shot:info:20 ticks of video passed (shot)."
"trigger:quartile1": "info:First quartile of video entered."
"trigger:quartile2": "info:Second quartile of video entered."
"trigger:quartile3": "info:Third quartile of video entered."
"trigger:quartile4": "info:Fourth quartile of video entered."
"trigger:first_quartile": "info:First quartile of video reached."
"trigger:midpoint": "info:Midpoint of video reached."
"trigger:third_quartile": "info:Third quartile of video reached."
"trigger:play": "info:Video is playing."
"trigger:pause": "info:Video paused."
"trigger:stop": "info:Video stopped."
"trigger:foreground": "info:Video moved to foreground."
"trigger:background": "info:Video moved to background."
"trigger:back": "info:Video back executed."

Yes

Sets up a video/audio trigger.

Note: For trigger key complete, the action player:auto:next is automatically set (please use trigger key end if you want to keep the default complete action). For property actions, it is not possible to provide an action-related data property. If you want to execute a property data action, please use the execute:fetch:{URL} action, alternatively.

video:duration {VIDEO_DURATION}

"video:duration:": "60"

Yes

Sets up a custom video duration in seconds. If a custom duration is set, only that duration is displayed during playback. It can be used for live data or ads to disable the progress feature.

video:position {VIDEO_POSITION}

"video:position:": "0"

Yes

Sets up a custom video position in seconds. If a custom position is set, only that position is displayed during playback and it is not possible to seek to another position (instead a custom:video:seek event is triggered). It can be used for live data or ads to disable the seek feature.

video:speed {VIDEO_SPEED}

"video:speed:": "1"

Yes

Sets up a custom video speed. If a custom speed is set, only that speed is displayed during playback and it is not possible to change it (instead a custom:video:speed event is triggered). It can be used for live data or ads to disable the speed feature.

Note: The actual video speed is not changed. For example, if the custom video speed is set to x0.5, the actual video may still be playing at normal speed.

video:state {VIDEO_STATE}

"video:state:": "2"

Yes

Sets up a custom video state. If a custom state is set, only that state is displayed during playback and it is not possible to change it (instead a custom:video:play or custom:video:pause event is triggered). It can be used for live data or ads to disable the play/pause feature.

  • 1: Stopped (not supported)
  • 2: Playing
  • 3: Paused

Note: The actual video state is not changed. For example, if the custom video state is paused, the actual video may still be in the playing state.

Example[edit]

Screenshot[edit]

Example Screenshot (Extended Properties)

Code[edit]

{
    "type": "pages",
    "headline": "Extended Properties Test",
    "template": {
        "type": "separate",
        "layout": "0,0,2,4",
        "icon": "msx-white-soft:movie",
        "color": "msx-glass"
    },
    "items": [{
            "title": "Video 1",
            "playerLabel": "Video 1",
            "action": "video:http://msx.benzac.de/media/video1.mp4",
            "properties": {
                "button:content:icon": "info",
                "button:content:action": "info:Live info executed.",
                "label:duration": "Live",
                "label:extension": "{ico:msx-red:live-tv}",
                "progress:color": "msx-red",
                "progress:type": "reverse:time:[H:]M:ss"
            }
        }, {
            "title": "Video 2",
            "playerLabel": "Video 2",
            "action": "video:http://msx.benzac.de/media/video2.mp4",
            "properties": {
                "button:content:icon": "info",
                "button:content:action": "info:Ad info executed.",
                "button:forward:enable": "false",
                "button:rewind:enable": "false",
                "button:restart:enable": "false",
                "button:speed:enable": "false",
                "label:extension": "{txt:msx-yellow:Ad}",
                "progress:color": "msx-yellow",
                "progress:type": "text:s",
                "progress:marker:enable": "false"
            }
        }, {
            "title": "Video 3",
            "playerLabel": "Video 3",
            "action": "video:http://msx.benzac.de/media/video3.mp4",
            "properties": {
                "button:content:icon": "info",
                "button:content:action": "info:Video info executed.",
                "label:extension": "{ico:msx-blue:local-play}",
                "progress:color": "msx-blue",
                "progress:type": "percentage",
                "trigger:midpoint": "info:Midpoint of video reached."
            }
        }]
}

Demo[edit]