当前位置:   article > 正文

vue项目如何播放m3u8格式视频_vue 播放m3u8

vue 播放m3u8

安装依赖

 npm install @easydarwin/easyplayer --save
 npm install copy-webpack-plugin@5.1.2 --save-dev
  • 1
  • 2

找到public/index.html

在node_modeols里面找到@easydarwin下的dist/compent/EasyPlayer-lib.min.js和EasyPlayer.wasm两个文件复制到pubilc目录下

引入

	<script src="./EasyPlayer-lib.min.js"></script>
  • 1

再要播放的地方

1、引入

import EasyPlayer from "@easydarwin/easyplayer"
  • 1

2、注册

在components中

components:{EasyPlayer}
  • 1

3、使用组件

在模板中

<EasyPlayer :id="Math.floor(Math.random()*1+1)" :videoUrl=item :live="true" />
  • 1

4、样式自己调整

5、双击可全屏

结果

在这里插入图片描述

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号