vue前端采用videojs模块,实现rtmp视频流播放

node安装videojs和videojs-flash模块

npm%20install%20video.js%20%20videojs-flash

vue引入模块和样式

<template>
<video
%20%20%20%20id="my-player"
%20%20%20%20class="video-js"
%20%20%20%20controls
%20%20%20%20preload="auto"
%20%20%20%20poster="//vjs.zencdn.net/v/oceans.png"
%20%20%20%20data-setup='{}'>
%20%20<source%20src="%20"%20%20type="rtmp/mp4"></source>
%20%20<p%20class="vjs-no-js">
%20%20%20%20To%20view%20this%20video%20please%20enable%20JavaScript,%20and%20consider%20upgrading%20to%20a
%20%20%20%20web%20browser%20that
%20%20%20%20<a%20href="https://videojs.com/html5-video-support/"%20target="_blank">
%20%20%20%20%20%20supports%20HTML5%20video
%20%20%20%20</a>
%20%20</p>
</video>
</template>

<script>
import%20videojs%20from%20'video.js';
import%20"videojs-flash"
import%20"video.js/dist/video-js.min.css"
export%20default%20{
%20%20name:%20"VideoPlay",
%20%20}
</script>

参考
%20https://github.com/videojs