$.ajax({
//请求方式
type:"GET",
//文件位置
url:"../../../Runtime" + "/js/psData.js?_t="+Date.parse(new Date()),
//返回数据格式为json,也可以是其他格式如
dataType: "json",
success: function(data){
console.log(data);
// let ps = data;
// if(ps[6].ads[0].name.indexOf("m3u8") != -1){
// $(".embed_video .btn").show(0);
// $(".prev_video").show(0);
// $(".videoAd").hide(0);
// $(".embed_video .btn").on("click", function(){
// $(this).hide(0);
// $(".prev_video").html("").hide(0);
// window.open(ps[6].ads[0].url);
// });
// var prevVideo=initVideo({
// id:'prevVideo',
// url:ps[6].ads[0].name,
// cb: function(){
// $(".embed_video .btn").hide(0);
// $(".prev_video").html("").hide(0);
// }
// });
// }
}
});
$(".typeBtn").on("click", function(){
const text = $(this).text();
if(text.includes("香港")){
window.location.href = "index8057.html?s=vod-show-id-1.html";
}else if(text.includes("国产")){
window.location.href = "indexd390.html?s=vod-show-id-2.html";
}else if(text.includes("日本")){
window.location.href = "indexb0de.html?s=vod-show-id-12.html";
}else if(text.includes("韩国")){
window.location.href = "indexe57f.html?s=vod-show-id-3.html";
}else if(text.includes("欧美")){
window.location.href = "indexb06c.html?s=vod-show-id-4.html";
}else{
console.log("type error");
}
});
var myVideo=initVideo({
id:'myVideo',
url:vPath,
cb: function(){
console.log("xxx");
}
// ad:{
// pre:{
// url:ps&&ps[16]&&ps[16].ads&&ps[16].ads[0]&&ps[16].ads[0].name,
// link:ps&&ps[16]&&ps[16].ads&&ps[16].ads[0]&&ps[16].ads[0].url
// },
// pause:{
// url:ps&&ps[17]&&ps[17].ads&&ps[17].ads[0]&&ps[17].ads[0].media,
// link:ps&&ps[17]&&ps[17].ads&&ps[17].ads[0]&&ps[17].ads[0].url
// }
// }
});
var preVideo = initVideo({
id:'prevVideo',
url:"#",
cb: function(){
console.log("xxx");
}
});
preVideo.on("ended", function(){
preImgad(false);
});
$(".tgBtn").on("click", function(){
preVideo.pause();
preImgad(true);
});
myVideo.on('pause', function(){
$(".apausead").show(0);
$(".skipBtn").show(0);
});
myVideo.on('play', function(){
$(".apausead").hide(0);
$(".skipBtn").hide(0);
});
$(".timeBtn").on("click", function(){
$(".aprevad1").hide(0);
$(".aprevad2").hide(0);
$(".timeBtn").hide(0);
window.open("https://2360.oss-cn-shanghai.aliyuncs.com/2360-app/XPJ.apk", "_blank")
tag = false;
});
$(".skipBtn").on("click", function(){
$(".apausead").hide(0);
$(".skipBtn").hide(0);
});
function preImgad(params){
$(".tgBtn").hide(0);
$(".prev_video").hide(0);
let totalTime = 5;
$(".aprevad1").show(0);
$(".timeBtn").show(0);
$(".timeBtn").text("跳过广告:" + totalTime + "s");
if(params){
window.open("https://2360app.com", "_blank");
}
const timer = setInterval(()=>{
totalTime--;
$(".timeBtn").text("跳过广告:" + totalTime + "s");
if(totalTime == 0){
$(".aprevad1").hide(0);
$(".timeBtn").hide(0);
clearInterval(timer);
}
}, 1000);
}
var paused = false;
var vol = 0.1;
var time = 10;
document.onkeyup = function (event) {
console.log("keyCode:" + event.keyCode);
var e = event || window.event || arguments.callee.caller.arguments[0];
if (e && e.keyCode === 37) {
console.log(333)
let currentlTime = myVideo.currentTime();
myVideo.currentTime(currentlTime - time);
return false;
} else if (e && e.keyCode === 39) {
let currentrTime = myVideo.currentTime();
myVideo.currentTime(currentrTime + time);
return false;
} else if (e && e.keyCode === 32) {
paused === true ? myVideo.play() : myVideo.pause();
paused = !paused;
return false;
}
};