shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
whenVideoReady
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.when
Wait until the passed video is ready to play.
It checks if the video metadata has been loaded, and if not it waits for the loadedmetadata event.
Params
- $video*-HTMLVideoElement
The video to check the ready state
Return
- -Promise
The promise that will be resolved when the video is ready to play
Example
import { whenVideoReady } from '@blackbyte/sugar/dom'
whenVideoReady($myCoolHTMLVideoElement).then(($video) => {
// do something when the video is ready to play
});Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space