video.js是5.6版本,flash也引入了,在谷歌上也设置flash允许访问了,但是rtmp视频流就是不播,也没报错,怎么能播放呢
代码呢
<video
id="my-player"
class="video-js vjs-default-skin"
preload="auto"
data-setup="{}" >
<source src="videoSrc" type="rtmp/flv">
</video>
import videojs from "video.js";
import "video.js/dist/video-js.css";
import "videojs-flash";
import SWF_URL from "videojs-swf/dist/video-js.swf"
videojs.options.flash.swf = SWF_URL
mounted(){
this.videoSrc = "rtmp://127.0.0.1:1935/live/"
this.videoPlayer = videojs("my-player");//关联video的id
this.videoPlayer.src({
type: "rtmp/flv",
src:videoUrl//要播放的视频流url
});
this.videoPlayer.play();//进行播放
}