Skip to content

Commit a59fbf0

Browse files
committed
update example code
1 parent 1a514b3 commit a59fbf0

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

examples/02-video.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<md-card>
33
<md-card-actions v-md-ink-ripple>
44
<div class="md-subhead">
5-
<span>Only Flash & custom event name / 仅使用Flash模式播放 & 自定义事件名称</span>
5+
<span>Only Flash & custom event name & hotkeys plugin / 仅使用Flash模式播放 & 自定义事件名称 & 热键插件</span>
66
</div>
77
<md-button class="md-icon-button"
88
target="_blank"
@@ -14,6 +14,7 @@
1414
<div class="item">
1515
<div class="player">
1616
<video-player :options="playerOptions"
17+
@ready="playerIsReady"
1718
@changed="playerStateChanged($event)"
1819
ref="videoPlayer">
1920
</video-player>
@@ -24,6 +25,8 @@
2425
</template>
2526

2627
<script>
28+
// hotkeys plugin
29+
require('videojs-hotkeys')
2730
export default {
2831
data() {
2932
return {
@@ -39,7 +42,7 @@
3942
}],
4043
language: 'zh-CN',
4144
techOrder: ['flash'],
42-
poster: "/static/images/author-2.jpg"
45+
poster: "/vue-video-player/static/images/author-2.jpg"
4346
}
4447
}
4548
},
@@ -51,6 +54,14 @@
5154
methods: {
5255
playerStateChanged(playerCurrentState) {
5356
// console.log('example 2: state changed', playerCurrentState)
57+
},
58+
playerIsReady(player) {
59+
console.log('example 2 ready!', player)
60+
player.hotkeys({
61+
volumeStep: 0.1,
62+
seekStep: 5,
63+
enableModifiersForNumbers: false
64+
})
5465
}
5566
}
5667
}

examples/03-video.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</template>
2424

2525
<script>
26+
// resolution-switcher plugin
2627
require('videojs-resolution-switcher')
2728
require('videojs-resolution-switcher/lib/videojs-resolution-switcher.css')
2829
export default {

examples/04-video.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</template>
2424

2525
<script>
26+
// hls plugin
2627
require('videojs-contrib-hls/dist/videojs-contrib-hls')
2728
export default {
2829
data() {

examples/05-video.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</template>
2222

2323
<script>
24+
// youtube plugin
2425
require('videojs-youtube')
2526
require('videojs-contrib-hls/dist/videojs-contrib-hls')
2627
export default {

0 commit comments

Comments
 (0)