Skip to content
This repository has been archived by the owner on Jun 6, 2020. It is now read-only.

Commit

Permalink
upgrade dplayer to 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sinchang committed Jul 27, 2017
1 parent 6e3492f commit 2687adb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
24 changes: 18 additions & 6 deletions example/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
<github-badge slug="sinchang/vue-dplayer" />
<d-player :video="video"
:autoplay="autoplay"
:contextmenu="contextmenu"
screenshot="true"
@play="play"
ref="player">
</d-player>
<button class="btn btn-primary" @click="switchHandle">switch</button>
</div>
</template>

Expand All @@ -22,19 +25,28 @@
url: 'http://static.smartisanos.cn/common/video/t1-ui.mp4',
pic: 'http://static.smartisanos.cn/pr/img/video/video_03_cc87ce5bdb.jpg'
},
autoplay: false
videoUrl: 'http://static.smartisanos.cn/common/video/video-jgpro.mp4',
autoplay: false,
player: null,
contextmenu: [
{
text: 'GitHub',
link: 'https://github.com/MoePlayer/vue-dplayer'
}
]
}
},
mounted() {
// const player = this.$refs.player.dp
// player.play()
// setTimeout(() => {
// player.pause()
// }, 2000)
this.player = this.$refs.player.dp
},
methods: {
play() {
console.log('play callback')
},
switchHandle() {
this.player.switchVideo({
url: 'http://static.smartisanos.cn/common/video/video-jgpro.mp4'
})
}
},
components: {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "vue-dplayer",
"description": "A Vue 2.x video player component based on DPlayer",
"version": "0.0.2",
"version": "0.0.3",
"main": "dist/Vue-DPlayer.js",
"files": [
"dist"
],
"scripts": {
"test": "echo lol",
"lint": "vbuild -c vbuild.example.js --eslint",
"build:example": "vbuild -c vbuild.example.js",
"build": "npm run build:cjs && npm run build:umd",
"build:cjs": "vbuild -c vbuild.component.js --format cjs",
"build:umd": "vbuild -c vbuild.component.js --format umd",
Expand All @@ -32,7 +32,7 @@
},
"license": "MIT",
"dependencies": {
"dplayer": "^1.1.4",
"dplayer": "^1.5.0",
"vue-github-badge": "^1.0.0"
}
}
}
20 changes: 9 additions & 11 deletions src/VueDPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
type: String,
default: 'auto'
},
contextmenu: {
type: Array
},
logo: {
type: String
},
video: {
type: Object,
required: true,
Expand All @@ -57,6 +63,8 @@
screenshot: this.screenshot,
hotkey: this.hotkey,
preload: this.preload,
contextmenu: this.contextmenu,
logo: this.logo,
video: {
url: this.video.url,
pic: this.video.pic,
Expand Down Expand Up @@ -90,14 +98,4 @@
}
}
</script>

<style>
.dplayer.dplayer-no-danmaku .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box {
height: auto;
}
.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-showdan,
.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku {
display: none;
}
</style>
<style src="../node_modules/dplayer/dist/DPlayer.min.css"></style>

0 comments on commit 2687adb

Please sign in to comment.