标签:rom lte 安装 splay edm import lse use custom
安装
import hls from ‘videojs-contrib-hls‘ import VideoPlayer from ‘vue-video-player‘; import "video.js/dist/video-js.css" import "vue-video-player/src/custom-theme.css" Vue.use(hls) Vue.use(VideoPlayer)
<video id="my-video" class="video-js vjs-default-skin" controls preload="auto"> <source src="http://ivi.bupt.edu.cn/hls/cctv1.m3u8" type="application/x-mpegURL" /> </video>
import "video.js/dist/video-js.css";
import videojs from "video.js";
import "videojs-contrib-hls";
mounted(){
videojs(
"my-video",
{
bigPlayButton: false,
textTrackDisplay: false,
posterImage: true,
errorDisplay: false,
controlBar: true
},
function() {
this.play();
}
);
}
页面中使用 第二种方式
<video-player class="video-player vjs-custom-skin" :playsinline="true" :options="‘http://ivi.bupt.edu.cn/hls/cctv1.m3u8‘|videoOption"> </video-player>
import ‘videojs-contrib-hls‘
filters:{
videoOption(val) {
console.log(‘val‘,val)
return {
live: false,
preload: "auto",
autoplay: true,
language: "zh-CN",
aspectRatio: "16:8",
fluid: true,
sources: [
{
src: val //url地址
}
],
notSupportedMessage: "此视频暂无法播放,请稍后再试", //允许覆盖Video.js无法播放媒体源时显示的默认信息。
controlBar: {
timeDivider: false,
durationDisplay: false,
remainingTimeDisplay: false,
fullscreenToggle: true //全屏按钮
},
flash: {
hls: {
withCredentials: false
}
}
}
},
}
vue 使用vue-video-player播放hls格式视频
标签:rom lte 安装 splay edm import lse use custom
原文地址:https://www.cnblogs.com/Byme/p/11419131.html