//全局变量,动态的文章id var shareid = ""; var sharemid = ""; var shareurl = ""; var sharepic = ""; var sharetext = ""; var videoid = ""; var videotime = ""; var videofile = ""; var videoposter = ""; var videowith= ""; var videoheight = ""; //绑定所有分享按钮所在a标签的鼠标移入事件,从而获取动态id $(function () { $("#j-v-img").click(function () { videofile = $(this).attr("data-file"); videoposter = $(this).attr("data-poster"); videowith= $(this).width(); videoheight = $(this).height(); signjwplayer(); }); $("#videoplay2").click(function () { videofile = $("#j-v-img").attr("data-file"); videoposter = $("#j-v-img").attr("data-poster"); videowith= $("#j-v-img").width(); videoheight = $("#j-v-img").height(); signjwplayer(); }); }); //设置视频播放 function signjwplayer() { if(browser.versions.weixin || browser.versions.mobile && (browser.versions.ios || browser.versions.android || browser.versions.iphone || browser.versions.ipad)){//手机图片放大 var html=''; if(videofile.indexof('mp4')>0){ $('#j-v-img').hide(); html+=''; html+=''; $('#j-v-video-m').html(html); $('#j-v-video-m').show(); }else{ } }else{ jwplayer( "j-v-video"). setup ({ autostart : true , file : videofile , image : videoposter, rtmp: { //缓存 bufferlength: 0.1 }, skin: { name: "glow" }, height : 400 , width : 640, key:'gjgjhsx+opyvyovhhu83ip66hctf6hq9uxbuhg==' }); $('#main_video').show(); } $('#video_close').bind('click',function(){ jwplayer("j-v-video").remove(); $('#main_video').hide(); }); }