Skip to main content
Creates and returns a videoContext object for the <video> component whose id is passed in. Use it to control video playback.

Before You Begin

  • The GriverSDK version must be at least 2.48.0; earlier versions can crash the app.
  • The Mini Program core library (Appx) must be version 2.0.
  • CSS animations are not supported.
  • Supported format: MP4 with H.264 encoding (iOS and Android).

Parameters

videoContext Methods

video Component Attributes

Error Codes

Code Example

FAQ

If the video loops, it is played from the cache; otherwise it is loaded again. The cache is cleared when the page or the Mini Program is closed.
Read videoDuration from the onTimeUpdate event.
Make sure the <video> has a unique id made only of letters, - and _, that is not too long and is not a reserved word (e.g. content-root, RenderView). Avoid IDs that are prefixes of other IDs (e.g. main-video and main-video-wrapper). If the component is positioned on the wrong layer, try the raw-controls property.

my.chooseVideo

Choose or record a video