源码地址 https://github.com/bilibili/flv.js
git clone https://github.com/bilibili/flv.js
cd flv.js-master
npm install
npm和node.js的安装不做介绍 不想那么麻烦的在这里提取
链接:网盘地址
提取码:kqls
直接上源码
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
Documentfunction f(type,url) {
if (flvjs.isSupported()) {
var videoElement = document.getElementById('videoElement');
var flvPlayer = flvjs.createPlayer({
type: type,
url: url,
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
flvPlayer.play();
}
}
/*视频名称*/
var videoTitle = "视频1|视频2|视频3";
var titleList = videoTitle.split("|");
for (var i = 0; i < titleList.length; i++){
if(titleList[i] != ""){
document.write(''+titleList[i]+'');
}
}
/*视频链接*/
var CuPlayerList ="1.mp4|2.mp4|3.mp4";
var sp =CuPlayerList.split("|")
var _ext =sp[0].split(".").pop();
if(sp.length<=0){
alert('没有视频!');
history.back();
}else {
$(".tvlistbox a").each(function (index) {
if(index==0){
$(this).css("background","#c7402a");
}else{
$(this).css("background","#eee");
}
})
f(_ext,sp[0]);
}
function changeStream(i){
$(".tvlistbox a").each(function (index) {
//console.log(index);
if(index==i){
$(this).css("background","#c7402a");
}else{
$(this).css("background","#eee");
}
})
var ext =sp[i].split(".").pop();
f(ext,sp[i]);
}