A Vue video player component based on DPlayer
npm install dplayer-vue> A Vue video player component based on DPlayer.


``bash`
npm install dplayer-vue -S
`js
import VueDPlayer from "dplayer-vue"
export default {
components: {
"d-player": VueDPlayer,
},
}
`
OR
`js`
import Vue from "vue"
import VueDPlayer from "dplayer-vue"
Vue.use(VueDPlayer)
| Name | Type | Default | Description |
| ------- | ------ | ------- | ------------------ |
| options | Object | -- | all player options |
Example:
`js
export default {
data() {
return {
options: {
apiBackend: {
read: (callback) => {
callback.error()
callback.success()
},
send: (callback) => {
callback.error()
callback.success()
}
}
}
}
}
`
Example:
`js
export default {
methods: {
play() {
console.log('play callback')
}
}
`
you can use all DPlayer APIs
Example:
`js
export default {
mounted() {
const player = this.$refs.player.dp
player.play()
setTimeout(() => {
player.pause()
}, 2000)
}
``
- DPlayer
This content is released under the MIT License.