videojs-resolution-switcher-v7
videojs-resolution-switcher-v7 copied to clipboard
"Error: plugin "videoJsResolutionSwitcher" does not exist"
大神,显示这个错误是什么原因呢---还需要设置什么吗
import videojs from 'video.js' import "videojs-flash" //在我们要使用的文件中导入就行 import '../../assets/css/video_test.css'
import '@xiaoyexiang/videojs-resolution-switcher-v7/lib/videojs-resolution-switcher-v7.css' // import 'videojs-resolution-switcher' if (process.client) { window.videojs = videojs require('@xiaoyexiang/videojs-resolution-switcher-v7') }
this.player = this.$video('#myVideo', this.playerOptions, function () { var player = this
大神,显示这个错误是什么原因呢---还需要设置什么吗
从'video.js' 导入videojs 导入“ videojs-flash” //在我们要使用的文件中导入就行 import'../../assets/css/video_test.css'
导入'@ xiaoyexiang / videojs-resolution-switcher-v7 / lib / videojs-resolution-switcher-v7.css' //导入'videojs-resolution-switcher'if (process.client){ window.videojs = videojs require(' @ xiaoyexiang / videojs-resolution-switcher-v7') }
this.player = this。$ video('#myVideo',this.playerOptions,function(){ var player = this
抱歉,现在才看到,这个是你配置函数里面的 'plugin' 有相关 'videoJsResolutionSwitcher' 的配置属性,但是 videoJsResolutionSwitcher 没有引入,已经这么久了,应该处理好了吧
如果是在 nuxtjs 里使用, 初始化记得 一定要在客户端,即 process.client
否则会报错,应该nuxtjs 会默认在 服务器 打包文件,但是 videoJsResolutionSwitcher 是在客户端引入的,具体原因看 nuxtjs 的文档