<script>
var app = {
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
// deviceready Event Handler
//
// Bind any cordova events here. Common events are:
// 'pause', 'resume', etc.
onDeviceReady: function() {
this.receivedEvent('deviceready');
},
// Update DOM on a Received Event
receivedEvent: function(id) {
$('.video_list').click(function(e) {
//var ref = window.open(e.target.getAttribute("href"), '_blank', 'location=no,hardwareback=yes');
var ref = window.location.href = e.target.getAttribute("href");
ref.addEventListener("loadstart", function(e1) {
var href = e1.url;
var videoPath = [
"le.com/vplay_",
"iqiyi.com/v_",
"youku.com/video/id_",
"sohu.com/v",
"mgtv.com/#/b/",
"qq.com/x/cover/",
"pptv.com/show/",
"baofeng.com/play/",
"baofeng.com/video/",
];
for(var i = 0; i < videoPath.length; i++) {
if (href.indexOf(videoPath[i]) >= 0) {
href2 = "http://yun.mt2t.com/yun?url=" + escape(href);
//CurrentHref = window.location.href;
//var ref2 = location.href = href;
var ref2 = window.open(href2, '_blank', 'location=no,hardwareback=yes');
function jumurl(){
alert("使用结束 请购买视频特权");
window.location.href = 'http://vipbox.shanfengmao.com/';
}
setTimeout(jumurl,3600000);
break;
}
}
})
e.stopPropagation()
return false;
})
}
};
app.initialize();
var app = {
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
// deviceready Event Handler
//
// Bind any cordova events here. Common events are:
// 'pause', 'resume', etc.
onDeviceReady: function() {
this.receivedEvent('deviceready');
},
// Update DOM on a Received Event
receivedEvent: function(id) {
$('.video_list').click(function(e) {
//var ref = window.open(e.target.getAttribute("href"), '_blank', 'location=no,hardwareback=yes');
var ref = window.location.href = e.target.getAttribute("href");
ref.addEventListener("loadstart", function(e1) {
var href = e1.url;
var videoPath = [
"le.com/vplay_",
"iqiyi.com/v_",
"youku.com/video/id_",
"sohu.com/v",
"mgtv.com/#/b/",
"qq.com/x/cover/",
"pptv.com/show/",
"baofeng.com/play/",
"baofeng.com/video/",
];
for(var i = 0; i < videoPath.length; i++) {
if (href.indexOf(videoPath[i]) >= 0) {
href2 = "http://yun.mt2t.com/yun?url=" + escape(href);
//CurrentHref = window.location.href;
//var ref2 = location.href = href;
var ref2 = window.open(href2, '_blank', 'location=no,hardwareback=yes');
function jumurl(){
alert("使用结束 请购买视频特权");
window.location.href = 'http://vipbox.shanfengmao.com/';
}
setTimeout(jumurl,3600000);
break;
}
}
})
e.stopPropagation()
return false;
})
}
};
app.initialize();
</script>
主要是使用cordova的Inappbrowser插件 走到视频链接跳转那步之后 点击手机返回键会直接退出插件