Skip to main content

Video

The Video embeds a media player which supports video playback into the document.

Props

AttributeDescriptionType
srcSets the current source of the video element.string
controlsSets whether the audio/video should display controls (like play/pause etc.).boolean
widthThe width of the video's display area.string
heightThe height of the video's display area.string
autoPlaySets whether the video should start playing as soon as it is loaded.boolean
mutedSets whether the video is muted or not.boolean
loopSets whether the video should start over again when finished.boolean
controlsListWhen specified, helps the browser select what controls to show on the media element whenever the browser shows its own set of controls. The allowed values are nodownload, nofullscreen and noremoteplayback.string
posterA URL for an image to be shown while the video is downloading. If this attribute isn't specified, nothing is displayed until the first frame is available, then the first frame is shown as the poster frame.string
preloadSets whether the video should be loaded when the page loads.string
visibleVisibility of Video component.boolean

Methods

AttributeDescriptionExample Code
playStarts playing the video.components.EdtrComp_1.play()
pausePauses the currently playing video.components.EdtrComp_1.pause()
loadRe-loads the video element.components.EdtrComp_1.load()
currentTimeSets or returns the current playback position in the video. (in seconds)components.EdtrComp_1.currentTime(), components.EdtrComp_1.currentTime(5)
durationReturns the length of the current video. (in seconds)components.EdtrComp_1.duration()
currentSrcReturns the URL of the current video.components.EdtrComp_1.currentSrc()
volumeSets or returns the volume of the video. (value from 0 to 1)components.EdtrComp_1.volume(),components.EdtrComp_1.volume(0.2)

Events

Events NameDescription
canPlayFires when the browser can start playing the video.
canPlayThroughFires when the browser can play through the video without stopping for buffering
durationChangeFires when the duration of the video is changed.
emptiedFires when the current playlist is empty.
endedFires when the current playlist is ended.
errorFires when an error occurred during the loading of an video.
pauseFires when the video has been paused.
playFires when the video has been started or is no longer paused.
playingFires when the video is playing after having been paused or stopped for buffering.
progressFires when the browser is downloading the video.
rateChangeFires when the playing speed of the audio/video is changed.
volumeChangeFires when the volume has been changed.
stalledFires when the browser is trying to get media data, but data is not available.
suspendFires when the browser is intentionally not getting media data.
timeUpdateFires when the current playback position has changed.
waitingFires when the video stops because it needs to buffer the next frame.

Samples Component

controls

The browser will offer controls to allow the user to control video playback, including volume, seeking, and pause/resume playback. default value: true

| control = true |

image

| control = false |

image

preload

This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience with regards to what content is loaded before the video is played. It may have one of the following values:

  • none: Indicates that the video should not be preloaded.
  • metadata: Indicates that only video metadata (e.g. length) is fetched.
  • auto: Indicates that the whole video file can be downloaded, even if the user is not expected to use it.
  • empty string: Synonym of the value. auto

Samples Qjson

QVideoExample