当前位置:   article > 正文

EasyPlayer+vue3+vite报错Cannotread properties of undefined(reading ‘ c‘)的解决方案_vue3 easy-player

vue3 easy-player

问题原因:EasyPlayer只兼容了vue2版本,在vue2版本可以使用npm引入的方式使用,在vue3版本不支持此方式使用,只能通过script引入的方式使用

解决方案:

1、先下载EasyPlayer的npm

npm i @easydarwin/easyplayer

2、在node_modules中按照以下路径找到@easydarwin/easyplayer/dist/component/EasyPlayer-component.min.js 拷贝到 public 下面

3、在index.html里面使用

4、直接在对应的vue文件里面使用

5、最重要的一步,因为EasyPlayer是基于video.js实现的,如果你的项目中没有引入video.js,即使按照以上方法操作了也会导致不能正常使用可通过npm引入video.js,无需在main.js里面引入

 $ npm install video.js

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/790742
推荐阅读
相关标签
  

闽ICP备14008679号