forked from surmon-china/videojs-player
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
33 lines (32 loc) · 1.01 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
*
* Vue-Video-Player
* Adapted from Videojs (https://github.com/videojs/video.js)
*
*/
window.WebVTT = require('videojs-vtt.js').WebVTT
window.videojs = require('video.js')
require('video.js/dist/alt/video-js-cdn.css')
videojs.options.flash.swf = "https://cdn.bootcss.com/video.js/5.13.0/video-js.swf"
var player = require('./player.vue')
var videoPlayerBuild = function(Vue) {
// videoPlayer.config()
Vue.component('video-player', player)
}
var videoPlayer = {
videoPlayer: player,
config: function(configs) {
if (!configs) return
configs.hls = configs.hls !== undefined ? configs.hls : true
configs.switcher = configs.switcher !== undefined ? configs.switcher : true
if (configs.hls) require('videojs-contrib-hls')
if (configs.youtube) require('videojs-youtube')
if (configs.vimeo) require('videojs-vimeo')
if (configs.switcher) require('videojs-resolution-switcher')
},
install: function(Vue) {
videoPlayer.config({})
videoPlayerBuild(Vue)
}
}
module.exports = videoPlayer