flv视频流页面播放
作者:互联网
步骤:
1、配置依赖
npm install --save flv.js2、在使用的页面中引用
import flvjs from 'flv.js'3、在mounted()中初始
mounted() { this.$nextTick(()=>{ if (flvjs.isSupported()) { let videoElement = document.getElementById('videoElement'); let flvPlayer = flvjs.createPlayer({ type: 'flv', isLive: true, hasAudio: false, url: 'http://192.168.120.159:8080/live/test.flv' }); console.log(flvPlayer, 'flv对象') flvPlayer.attachMediaElement(videoElement); flvPlayer.load(); flvPlayer.play(); } }) },
标签:flvPlayer,视频流,js,flv,let,videoElement,flvjs,页面 来源: https://blog.csdn.net/qq_42715494/article/details/122190305