videojs-player
videojs-player copied to clipboard
使用hls的时候在本地是正常的,编译放在服务器上就不显示了
使用hls的时候在本地是正常的,编译放在服务器上就不显示了,求!!!!
今天上线的时候才发现
同学,你要给出具体的错误,和你自己的判断,否则没有办法解决。
同样编译之后在服务器上运行报错:
我也是这个错
但是在edge浏览器上可以播放
遇到相同的问题,有没有解决方法?
因为你们config和build 中用的是严格模式'use strict',去掉再 打包 就好了
真的吗
我也遇到这个问题了,照着这个
https://github.com/surmon-china/vue-video-player/issues/34
在webpack配置文件module
里加入 noParse: [/videojs-contrib-hls/],
为什么我用这个组件播放hls流媒体视频的时候总是报错,我就是按照你的示例来做的
最新版,v5.0.0 应该是可以解决这个问题的,ps: 需要删除 node_modules
重新安装。
@ffdfgdfg 是正解。
导入了v5.0.0 把node_modules 删除了后.还是在报错: "Cannot read property 'EventTarget' of undefined"
@sunxiang0918 videojs-contrib-hls
依赖 window.videojs
全局变量,想办法使其能访问,像这里:
https://github.com/surmon-china/vue-video-player/blob/master/examples/04-video.vue#L32
@surmon-china 搞定了,谢谢了!!
我想问问是怎么解决的,我按照作者的 demo 代码如下: ` import 'video.js/dist/video-js.css'
import 'vue-video-player/src/custom-theme.css'
import { videoPlayer } from 'vue-video-player'
import videojs from 'video.js'
window.videojs = videojs
// hls plugin for videojs6
require('videojs-contrib-hls/dist/videojs-contrib-hls.js')
`
但是打包编译以后 还是报错: Uncaught ReferenceError: e is not defined
@chuanshuo-yongyuan 上面说了啊, @ffdfgdfg 的答案是正解。
@surmon-china 非常感谢,解决了,谢谢!!!
@JiangKunbo
在webpack配置文件module里加入 noParse: [/videojs-contrib-hls/]
这样一个简单的操作,很难实施吗
@JiangKunbo
开发模式下,已换成v5.0.0,还是报错:Uncaught ReferenceError: e is not defined
m3u8格式的视频,本地可以正常播放,打包发布之后就'No compatible source was found for this media.'变成这个,希望大佬解答一下,困扰几天了,感激不尽@surmon-china
How to use noParse in nuxt.config.js ...?
videojs 7.0版本已经不需要videojs-contrib-hls 麻烦 作者更新
同求
请问一下支持rmvb格式的视频吗?
m3u8格式的视频,本地可以正常播放,打包发布之后就'No compatible source was found for this media.'变成这个,希望大佬解答一下,困扰几天了,感激不尽@surmon-china
请问你解决了吗??
@surmon-china @ffdfgdfg @chuanshuo-yongyuan 我在webpack处已经添加这一行,
打包上传至服务器发现
这个要怎么处理呢?麻烦大家给个解决方案谢谢
请问vue-video-player动态绑定sources下的src导致不能播放视频,怎么解决?
@surmon-china 您好,我也遇到上诉的问题,本地运行正常,部署到线上控制台报错: e is not defined。
在webpack也已经配置:
js库各版本:
"vue-video-player": "^5.0.2",
"vue": "^2.5.11",
"video.js": "^7.5.4",
"videojs-contrib-hls": "^5.15.0",
项目代码
import 'vue-video-player/src/custom-theme.css'
import videojs from 'video.js'
window.videojs = videojs
require('videojs-contrib-hls/dist/videojs-contrib-hls.js')
<video-player class="vjs-custom-skin"
:options="playerOptions(item, idx)"
@ready="playerReadied">
</video-player>
playerOptions(item, idx){
return {
autoplay: false,
muted: true,
preload: 'auto',
language: "en",
aspectRatio: '16:9',
sources: [{
withCredentials: false,
type: "application/x-mpegURL",
src: item.url
}],
controlBar: {
timeDivider: false,
durationDisplay: false
},
flash: { hls: { withCredentials: false }},
html5: { hls: { withCredentials: false }},
poster: "https://gydev-1252687978.piccd.myqcloud.com/gy/pc-upload/20190506/768d8f3a-20cb-4e3f-bb8b-7b2ba459cc2c.png"
}
},
项目紧急,期待您的解答!! @surmon-china