var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf(‘Android’) > -1 || u.indexOf(‘Linux’) > -1;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if(isAndroid || isIOS){
console.log(window.location.href.substring(7,12))
$(“#vodPlayer”).html(‘‘);
}else{
console.log(window.location.href.substring(7,12))
$(“#vodPlayer”).html(‘‘);
$(“#vodPlayer .pc_video”).css({‘width’:’90%’,’height’:’100%’,’min-height’: ‘400px’});
//窄视频处理
var video = document.querySelector(‘video’);
var tankWidth = $(‘#vodPlayer’).width();
var videoNewHeight = parseInt(tankWidth/16*9);//视频的高度
video.addEventListener(‘canplay’, function () {
this.width = this.videoWidth;
this.height = this.videoHeight;
this.newScale = this.width/this.height;
this.videoNewWidth = parseInt(videoNewHeight*this.newScale);
if(this.width <= this.height){
$('#vodPlayer').css({'background':'#000','height':videoNewHeight})
$("#vodPlayer .pc_video").css({'width':this.videoNewWidth,'height':videoNewHeight});
$('#vodPlayer .pc_video').css('width',tankWidth)
}
});
}