Media Component
Media is an images, videos, or audio file embedded into your app.
By default, Dynaboard will automatically discover the appropriate media player to use. You can also explicitly specify the type
.
Properties
Visible
Prop | isVisible |
---|---|
Type | boolean |
Default | true |
Whether or not this node is visible.
Enabled
Prop | isEnabled |
---|---|
Type | boolean |
Default | true |
Whether or not this node is enabled.
Tooltip
Prop | tooltip |
---|---|
Type | string |
Default | undefined |
The tooltip text to display when hovered or focused over this node.
Top
Prop | top |
---|---|
Type | number |
Default | 1 |
The position of the node from the top side of the grid (grid-row-start
).
Left
Prop | left |
---|---|
Type | number |
Default | 1 |
The position of the node from the left side of the grid (grid-column-start
).
Width
Prop | width |
---|---|
Type | string |
Default | 100px |
The width of the node. When this node is in a grid layout, this should be done using unitless grid column units (specifying 4
will become grid-column-end: span 4
). When this node is in a stack layout, the width can be specified using CSS units (e.g. 100px
or 100%
), or be left unitless to be treated as flex-grow for the node.
Min Width
Prop | minWidth |
---|---|
Type | string |
Default | undefined |
The minimum width of the node. When this node is in a grid layout, this property is ignored.
Max Width
Prop | maxWidth |
---|---|
Type | string |
Default | undefined |
The maximum width of the node. When this node is in a grid layout, this property is ignored.
Height
Prop | height |
---|---|
Type | string |
Default | 100px |
The height of the node. When this node is in a grid layout, this should be done using unitless grid row units (specifying 4
will become grid-row-end: span 4
). When this node is in a stack layout, the height can be specified using CSS units (e.g. 100px
or 100%
), or be left unitless to be treated as flex-grow for the node.
Min Height
Prop | minHeight |
---|---|
Type | string |
Default | undefined |
The minimum height of the node. When this node is in a grid layout, this property is ignored.
Max Height
Prop | maxHeight |
---|---|
Type | string |
Default | undefined |
The minimum height of the node. When this node is in a grid layout, this property is ignored.
Overflow
Prop | overflow |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the horizontal and vertical axes for content that is larger than its container.
Overflow X
Prop | overflowX |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the horizontal axis for content that is larger than its container.
Overflow Y
Prop | overflowY |
---|---|
Type | Overflow ('auto' | 'visible' | 'hidden' | 'scroll') |
Default | auto |
The strategy used to handle overflow in the vertical axis for content that is larger than its container.
Custom Styles
Prop | styles |
---|---|
Type | string |
Default | ::component { } |
Custom CSS styles to be applied to the node. Use element.styles
to refer to the current node.
Object Fit
Prop | objectFit |
---|---|
Type | ObjectFit ('none' | 'contain' | 'cover' | 'fill' | 'scale-down') |
Default | cover |
The strategy used to set how the content of a replaced element should be resized to fit its container.
URL
Prop | url |
---|---|
Type | string |
Default | https://placekitten.com/g/200/200 |
URL of media resource to display.
Alternative Text
Prop | alt |
---|---|
Type | string |
Default | Placeholder kitten images for developers |
The alternative text to use instead of media resource on assistive devices.
Type
Prop | type |
---|---|
Type | MediaResourceType ('auto' | 'image' | 'video' | 'audio') |
Default | auto |
The type of media to be displayed. When set to auto
(the default), the media type will be guessed automatically.
Disabled
Prop | isDisabled |
---|---|
Type | boolean |
Default | false |
Whether or not the media player is disabled.
Vertical Align
Prop | verticalAlign |
---|---|
Type | VerticalAlignType ('center' | 'top' | 'bottom') |
Default | center |
The alignment of the media along the vertical axis.
Horizontal Align
Prop | horizontalAlign |
---|---|
Type | HorizontalAlignType ('center' | 'left' | 'right') |
Default | center |
The alignment of the media along the horizontal axis.
Event Handlers
On Click
Handler | mediaNode.onClick |
---|
Called when the user clicks the node. Use this event to trigger downstream actions when this node is clicked.
On Double Click
Handler | mediaNode.onDoubleClick |
---|
Called when the user double clicks the node. Use this event to trigger downstream actions when this node is double clicked.
On Hover
Handler | mediaNode.onHover |
---|
Called when the user hovers on the node. Use this event to trigger downstream actions when this node is hovered.
On Leave
Handler | mediaNode.onLeave |
---|
Called when the user is not hovering over the node. Use this event to trigger downstream actions when this node is no longer hovered.
On Load
Handler | mediaNode.onLoad |
---|
Called when the media has loaded.
On Error
Handler | mediaNode.onError |
---|
Called when there was an error while loading or playing the media.
On Play
Handler | mediaNode.onPlay |
---|
Called when the media has started playing.
On Pause
Handler | mediaNode.onPause |
---|
Called when the media has paused.