Begins playback after a short countdown once the player is in view.
- Host the js and css on your server, or use these URLs:
- In the player studio add the URLS to the player config.
- Add
countdown
as the plugin name, and if you want to alter the countdown, use{"time":8}
as the plugin option.
Once you've added the plugin script to your page, you can use it with any video:
<script src="video.js"></script>
<link rel="stylesheet" href="videojs-countdown.min.css">
<script src="videojs-countdown.js"></script>
<script>
videojs(document.querySelector('video')).countdown();
</script>
There's also a working example of the plugin you can check out if you're having trouble.
You may pass in an options object to the plugin upon initialization. This object may contain any of the following properties:
Type: int
Default: 5
Number of seconds to count down. 0 would autostart without countdown.
Type: boolean
Default: false
If true, automatic playback starts muted. Leaves volume/mute state unaffected if the countdown is cancelled.
- 0.1.0: Initial release