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
Is a watched video loaded again?
Is a watched video loaded again?
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.
How do I get the video length?
How do I get the video length?
Read
videoDuration from the onTimeUpdate event.The video context doesn't work or the video is misplaced
The video context doesn't work or the video is misplaced
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.Related APIs
my.chooseVideo
Choose or record a video