加入CODE CHINA

· 不限速    · 不限空间    · 不限人数    · 私仓免费

免费加入
README.md

Vue-DPlayer

A Vue 2.x video player component based on DPlayer.

NPM version Vue 2.x NPM downloads

Live Demo

Install

npm install vue-dplayer -S

Usage

CDN: https://unpkg.com/vue-dplayer@latest/dist/

import VueDPlayer from 'vue-dplayer'
import 'vue-dplayer/dist/vue-dplayer.css'

export default {
  components: {
    'd-player': VueDPlayer
  }
}

Props

Options Doc

Name Type Default Description
options Object -- all player options

Events

Event binding Doc

Example:

<d-player @play="play"></d-player>

export default {
    methods: {
      play() {
        console.log('play callback')
      }
    }

API

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)
    }

Related

License

This content is released under the MIT License.

项目简介

🚀 Github 镜像仓库 🚀

源项目地址

https://github.com/moeplayer/vue-dplayer

发行版本 3

support window.VueDPlayer

全部发行版

贡献者 4

开发语言

  • Vue 46.2 %
  • JavaScript 28.1 %
  • HTML 25.7 %