1
1
[ ![ GitHub issues] ( https://img.shields.io/github/issues/surmon-china/vue-video-player.svg?style=flat-square )] ( https://github.com/surmon-china/vue-video-player/issues )
2
2
[ ![ GitHub forks] ( https://img.shields.io/github/forks/surmon-china/vue-video-player.svg?style=flat-square )] ( https://github.com/surmon-china/vue-video-player/network )
3
3
[ ![ GitHub stars] ( https://img.shields.io/github/stars/surmon-china/vue-video-player.svg?style=flat-square )] ( https://github.com/surmon-china/vue-video-player/stargazers )
4
- [ ![ Twitter] ( https://img.shields.io/twitter/url/https/github.com/surmon-china/vue-video-player.svg?style=flat-square )] ( https://twitter.com/intent/tweet?text=Wow:& url=%5Bobject%20Object%5D )
4
+ [ ![ Twitter] ( https://img.shields.io/twitter/url/https/github.com/surmon-china/vue-video-player.svg?style=flat-square )] ( https://twitter.com/intent/tweet?url=https://github.com/surmon-china/vue-video-player )
5
5
6
6
[ ![ NPM] ( https://nodei.co/npm/vue-video-player.png?downloads=true&downloadRank=true&stars=true )] ( https://nodei.co/npm/vue-video-player/ )
7
7
8
8
9
9
# Vue-Video-Player
10
- Video.js player component for Vue2.
11
-
12
- Build by [ video.js] ( https://github.com/videojs/video.js ) .
10
+ [ Video.js] ( https://github.com/videojs/video.js ) player component for Vue2.
13
11
14
12
15
13
# Example
@@ -37,15 +35,17 @@ var Vue = require('vue')
37
35
var VueVideoPlayer = require (' vue-video-player' )
38
36
39
37
40
- // or import 'vue-quill-editor/ssr' to used in Nuxt.js/ssr
41
- var VueVideoPlayer = require (' vue-video-player/ssr' )
42
-
43
-
44
- // mount with global (If used in nuxt.js / SSR, you should keep it only in a browser-built environment)
38
+ // mount with global
45
39
Vue .use (VueVideoPlayer)
46
40
47
41
48
- // mount with component(can't work in ssr)
42
+ // If used in Nuxt.js/SSR, you should keep it only in browser build environment
43
+ if (process .BROWSER_BUILD ) {
44
+ const VueVideoPlayer = require (' vue-video-player/ssr' )
45
+ Vue .use (VueVideoPlayer)
46
+ }
47
+
48
+ // mount with component(can't work in Nuxt.js/SSR)
49
49
import { videoPlayer } from ' vue-video-player'
50
50
51
51
export default {
@@ -59,8 +59,8 @@ export default {
59
59
### Use the difference(使用方法的区别)
60
60
61
61
* SSR and the only difference in the use of the SPA:*
62
- - SPA uses the ` component ` , find quill instance by ` ref attribute ` .
63
- - SSR use ` directive ` , find quill instance by ` directive arg ` .
62
+ - SPA uses the ` component ` , find videojs instance by ` ref attribute ` .
63
+ - SSR use ` directive ` , find videojs instance by ` directive arg ` .
64
64
- Other configurations, events are the same.
65
65
66
66
### Use in SSR
0 commit comments