var RUN = { isMobile:function(){ var userAgentInfo = navigator.userAgent,Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"],flag = false; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = true; break; } } return flag; }, singVideo:function(dom,data,size){ //鍗曚釜瑙嗛鎾斁鍣紝鍙噸澶嶈皟鐢 if(data.poster==""||data.poster==null||data.poster=='undefined'){ data.poster='images/video-def.jpg'; } if(RUN.isMobile()){ size.width = '100%'; size.height = (size.height/100-0.25)+'rem'; var singleVideo = dom.jPlayer({ ready: function () { $(this).jPlayer("setMedia", data); $(this).find("video").attr({ "x5-playsinline":"true", "x-webkit-airplay":"allow", "playsinline":"", "controls":false }); }, play:function(event){ $(this).find("video").attr({ "controls":true }); }, swfPath: "../../dist/jplayer", supplied: "webmv, ogv, m4v", size: { width: size.width, height: size.height, cssClass: size.cls }, fullWindow:false, noFullWindow:{ android_phone: /android.*?mobile/, iphone: /iphone/, }, nativeVideoControls:{ all: /./ }, preload:'auto', useStateClassSkin: true, autoBlur: true, smoothPlayBar: true, keyEnabled: true, remainingDuration: false, toggleDuration: true }); } else{ size.width +='px'; size.height +='px'; var singleVideo = dom.jPlayer({ ready: function () { $(this).jPlayer("setMedia", data); dom.parent().find(".jp-mute").on("mouseover",function(){ var that = $(this); $(this).prev().css({ 'visibility': 'visible', }); $(this).parent().addClass("jp-volume-controls-sel"); $(this).parent().off().mouseleave(function(){ $(this).removeClass("jp-volume-controls-sel"); that.prev().css({ 'visibility': 'hidden', }); }); });; }, swfPath: "../../dist/jplayer", supplied: "webmv, ogv, m4v", size: { width: size.width, height: size.height, cssClass: size.cls }, useStateClassSkin: true, autoBlur: true, smoothPlayBar: true, keyEnabled: true, remainingDuration: false, toggleDuration: true }); } }, videoOpen:function(dom,data,size){ var html = '
'+ '
'; // dom.off().on("click",function(){ $('#jp_container_'+ dom.attr("data-id")).remove(); $("body").append(html); $(".jp-close").off().on("click",function(){ $('#jp_container_'+ dom.attr("data-id")).remove(); $('.jp-mask').remove(); }); var singleVideo = $('#jquery_jplayer_'+ dom.attr("data-id")).jPlayer({ ready: function () { $(this).jPlayer("setMedia", data); $('#jp_container_'+ dom.attr("data-id")).parent().find(".jp-mute").on("mouseover",function(){ var that = $(this); $(this).prev().css({ 'visibility': 'visible', }); $(this).parent().addClass("jp-volume-controls-sel"); $(this).parent().off().mouseleave(function(){ $(this).removeClass("jp-volume-controls-sel"); that.prev().css({ 'visibility': 'hidden', }); }); });; }, swfPath: "../../dist/jplayer", supplied: "webmv, ogv, m4v", size: { width: size.width, height: size.height, cssClass: size.cls }, useStateClassSkin: true, autoBlur: true, smoothPlayBar: true, keyEnabled: true, cssSelectorAncestor: "#jp_container_" + dom.attr("data-id"), remainingDuration: false, toggleDuration: true }); if(RUN.isMobile()){ $(".jp-video-open").css("top","35%") } // }); } } $(function(){ $(".run-open").each(function(index){ $(this).off().on("click",function(){ var videoHref = $(this).attr("data-href"); var videoPoster = $(this).attr("data-poster"); if(videoHref == "" && videoHref == null && videoHref == undefined){ videoHref.attr("data-href","https://www.crc.com.cn/newyear/2020/b.mp4") } if(videoPoster == "" && videoPoster == null && videoPoster == undefined){ videoPoster.attr("data-poster","../../images/video-def.jpg") } var data = { title: "", m4v: videoHref, poster: videoPoster }; var size = { width:800, height:550, cls:'jp-video-800p' } RUN.videoOpen($(this),data,size); }); }); });