A Vue 2.x video player component based on DPlayer.
npm install vue-dplayer -S
CDN: https://unpkg.com/vue-dplayer@latest/dist/
import VueDPlayer from 'vue-dplayer'
import '../node_modules/vue-dplayer/vue-dplayer.css'
export default {
components: {
'd-player': VueDPlayer
}
}
Name | Type | Default | Description |
---|---|---|---|
options | Object | -- | all player options |
Example:
<d-player @play="play"></d-player>
export default {
methods: {
play() {
console.log('play callback')
}
}
you can use all DPlayer APIs
Example:
<d-player ref="player"></d-player>
export default {
mounted() {
const player = this.$refs.player.dp
player.play()
setTimeout(() => {
player.pause()
}, 2000)
}
This content is released under the MIT License.