意甲官方冠名赞助商出任热刺官方合作伙伴 - 意甲官方冠名赞助商

网站无障碍 适老版
直播倒计时

0 天 0 时 0 分 0 秒

直播倒计时

0 0 0 0

预约

意甲官方冠名赞助商冀时新闻

关闭

`; } function wsMessage(data) { console.log('wsMessage', data) //收到消息 //直播信息修改 if (data.type) { if(data.type==5){//新增评论 let comment=`

${data.msg.nickName}:${data.msg.content}

` $('.content-box').append(comment) setTimeout(function(){ if($('.title-box').scrollTop()<($('.content-box').innerHeight()-250)){ $('.new-msg').show() } },50) }else if (data.msg && data.msg.data) { // if(data.msg.data.status!=liveData.status||data.msg.data.livePath!=liveData.livePath){ // //防止同时刷新页面并发大 // let timer = getRandomNumber(0, 10000); // setTimeout(function(){ // window.locations.reload(); // },timer) // } showLive(data.msg.data) } } if (data.handle) { if (data.handle == "showState" && liveData.status != 0 && liveData.status != 2 && liveData.status != 3) {//正在讲解 let btn = '¥' + data.showItem.price + '' if (isWX()) { let alias = UrlAdr(data.showItem.buyUrl).alias btn = `
${createWxOpenApp()}¥${data.showItem.price}
`; } let str = '
transparent

' + data.showItem.title + '

' + btn + '
' $('.main').children('#talkingGoods').remove() $('.main').append(str) $('.title-box').css('width', '65%') $('.closeBtn').on('click', function () { $('.title-box').css('width', '80%') $(this).parent().remove() }) $('.goodsName').on('click', function () { $('.shopModel').removeClass('slideDown'); $('.shopModel').addClass('slideUp'); }) $('#talkingGoods>img').on('click', function () { $('.shopModel').removeClass('slideDown'); $('.shopModel').addClass('slideUp'); }) $('#talkingGoods>.goodsPrice').on('click', function () { $('.main').html('

页面跳转中...

'); }) } if (Array.isArray(data.items)) { goodsData = data.items } renderGoods(data.items) } } $('.closeShop').on('click',function(){ $('.shopModel').removeClass('slideUp'); $('.shopModel').addClass('slideDown'); }) //渲染直播相关信息 function onLoadFn() { //获取直播详情 // https://web.cmc.hebrts.cn/cmsback/api/micro/live/seat/live.json?tenantId=0d91d6cfb98f5b206ac1e752757fc5a9&articleId=11321329 $.ajax({ url: webUrl + "cmsback/api/micro/live/seat/live?tenantId="+tenantId+"&articleId=" + articleId,//同文件夹下的json文件路径 type: "GET",//请求方式为get dataType: "json", //返回数据格式为json success: function (data) {//请求成功完成后要执行的方法 let nowDate = new Date().getTime(); //超过过期时间 //if (nowDate > data.data.timestamp + 1 * 60 * 1000) { // getLiveDetailNew() //} else { $(document).ready(function() { $("body").css("max-width", "500"); }); let appCustomParams=JSON.parse(data.data.appCustomParams) weappName=appCustomParams.liveHouse.mallSourceId console.log(appCustomParams,'appCustomParams') let isshow=false if(appCustomParams.liveHouse.shoppingCart == 0){ $('#shopBtn').hide() }else{ isshow=true if(isshow){ $('#shopBtn').append('width'); } } //showLive(data.data) $('#launch-btn').attr('extinfo', '{"id":"' + data.data.articleId + '","type":"15","url":"' + data.data.h5Url + '"}') templateSDK.wx_share({ share_title: data.data.title, share_summary: data.data.intro, share_logo:data.data.shareThumbnail || data.data.imagepath }); //} }, error: function () { // getLiveDetailNew() } }) //直播Websocket templateSDK.liveWebsocket({ id: articleId, callBack: wsMessage }) //访问量增加 // let timer = getRandomNumber(0, 3000); // setTimeout(function () { // $.ajax({ // url: apiUrl + '/cmsapi/api/content/read?article_id=' + articleId + '&tenantid=' + tenantId + '&type=1', // method: 'get', // }).then(res => { // if (res.state) { // $(".hitCount").html((res.data.reads_format || 0) + '人次观看'); // } // }) // }, timer) } onLoadFn() function showGoodsData() { $('.shopModel').removeClass('slideDown'); $('.shopModel').addClass('slideUp'); if (goodsData.length > 0) { renderGoods(goodsData) } else { $.ajax({ url: apiUrl + '/cms/api/micro/live/productBindList', type: 'get', headers: { "Content-Type": "application/json;charset=utf-8", 'tenantId': tenantId, }, data: { dataType: 'page', liveId: articleId, // tenantId: '4bf814b5cd921e2b38adb414e6b8303', pageNumber: 1, pageSize: 200, }, success: function (res) { if (res.state == 200 || res.state == "200") { goodsData = res.data renderGoods(res.data) } } }) } } function renderGoods(goodsData) { let goodsHtml = '' if (goodsData.length == 0) { goodsHtml = '

暂无商品

' } else { let talkObj = goodsData.find(item => item.showState == 5) if (!talkObj) { $('#talkingGoods').hide() } //第一个商品不是正在讲解中 if (goodsData[0].showState != 5) { if (talkObj) { let talkIndex = goodsData.findIndex(item => item.showState == 5) + 1 //购买按钮 let buyBtn = '' if (talkObj.pubState == 5) { //buyBtn = '立即购买1' buyBtn = '立即购买' if (isWX()) { let alias = UrlAdr(talkObj.buyUrl).alias //buyBtn = '
立即购买2
' buyBtn = `
立即购买 ${createWxOpenApp()}
`; } } else if (talkObj.pubState == 1) { buyBtn = '已下架' } let originPrice = '' if (talkObj.origin) { originPrice = '¥' + talkObj.origin + '' } goodsHtml = '
100%' + talkIndex + 'height讲解中

' + talkObj.title + '

¥' + talkObj.price + originPrice + '

' + buyBtn + '
' } } for (var i = 0; i < goodsData.length; i++) { let obj = goodsData[i]; let pic = JSON.parse(obj.picture)[0].url; let j = i + 1 //讲解中 let talk = '' if (obj.showState == 5) { talk = '50px讲解中' } //购买按钮 let buyBtn = '' if (obj.pubState == 5) { buyBtn = '立即购买' if (isWX()) { let alias = UrlAdr(obj.buyUrl).alias buyBtn = `
立即购买 ${createWxOpenApp()}
`; } } else if (obj.pubState == 1) { buyBtn = '已下架' } let originPrice = '' if (obj.origin) { originPrice = '¥' + obj.origin + '' } let == 5 ? 'onTalking' : '' goodsHtml += '
关闭' + j + '' + talk + '

' + obj.title + '

¥' + obj.price + originPrice + `${createWxOpenApp()}` + '

' + buyBtn + '
'; } $('.buyBtn').on('click', function () { $('.main').html('

页面跳转中...

'); }) } $('#shopBox').html(goodsHtml); templateSDK.wxOpenWeApp() } $('#shopBtn').on('click', function () { // $('.shopModel').show(); showGoodsData() }) //拿到当前时间 function getLocalTime() { var now = new Date(); var year = now.getFullYear(); var month = now.getMonth() + 1; var date = now.getDate(); var hour = (now.getHours() < 10) ? ("0" + now.getHours()) : now.getHours(); var minute = (now.getMinutes() < 10) ? ("0" + now.getMinutes()) : now.getMinutes(); var second = (now.getSeconds() < 10) ? ("0" + now.getSeconds()) : now.getSeconds(); return year + "/" + month + "/" + date + " " + hour + ":" + minute + ":" + second; } var nowTimeNew = new Date(getLocalTime()).getTime(); let share_logo = 'https://pic.cmc.hebrts.cn/0/0d91d6cfb98f5b206ac1e752757fc5a9/2024/09/01/bc00f0f1f72b41baa1f946136a81d13d.png'; share_logo=shareLogo ? shareLogo : share_logo; console.log(share_logo); // 隐藏横幅 if (!androidDownUrl) { $('#downTip').hide(); $('body').addClass('bodyWrap'); $('body').css('padding-top', '0'); } function formatNumber(num) { num = Number(num); if (num == 0) { return num + ''; } else if (num > 1 && num < 10000) { return num + ''; } else { return (num / 10000).toFixed(1) + '万'; } } // $(".hitCount").show().html(formatNumber($(".hitCount").text())+'人次观看') var templateSDK = new TemplateSDK({ switchConf: false, // 页面功能开关(点赞、评论等) 默认false:打开app;true:可以进行相关操作;json数据:控制单个功能 imgGray: false, // 图片变灰,默认false,设置为true时全局图片置灰 templateConf: { tenantId: tenantId, siteId: siteId, ajaxUrl: ajaxUrl, scmsUrl: scmsUrl, iosDownUrl: iosDownUrl, androidDownUrl: androidDownUrl, iosPKG: iosPKG, androidPKG: androidPKG, articleId: articleId, articleType: articleType, } });
${data.msg.nickNam${data.msg.content

' + obj.title + '

'; } $(".liveMore").before('

' + data.showItem.

'); $('.liveMore').html(liveMoreHtml); $(".btnImg").click(function(){ if($(".btnImg").attr("src")=="https://web.cmc.hebrts.cn/cms/rmt0336/public/img/shou1.png"){ $(".btnImg").attr("src","https://web.cmc.hebrts.cn/cms/rmt0336/public/img/zhan1.png"); $(".liveMore").hide(); }else{ $(".btnImg").attr("src","https://web.cmc.hebrts.cn/cms/rmt0336/public/img/shou1.png"); $(".liveMore").show(); } }) let wwidth = window.innerWidth > 500 ? 500 : window.innerWidth $(".liveDiv").click(function () { let num = $(this).attr('alt'); changeSeat(num) }); } } } }) } function updateWatermarkPosition(position) { // var isFullscreen = (document.fullscreenElement !== undefined && document.fullscreenElement === null) || // (document.mozFullScreen !== undefined && !document.mozFullScreen) || // (document.webkitIsFullScreen !== undefined && !document.webkitIsFullScreen); // // var topValue = isFullscreen ? '8%' : '12%'; // var leftValue = isFullscreen ? '5%' : '12%'; // var heightValue = isFullscreen ? 30 : 60; // $('#watermarkContainerimg').css('height', heightValue); // switch (position) { // case '': // case '1': // $('#watermarkContainer').css('top', topValue); // $('#watermarkContainer').css('left', leftValue); // break; // case '2': // $('#watermarkContainer').css('top', topValue); // $('#watermarkContainer').css('right', leftValue); // break; // case '3': // $('#watermarkContainer').css('left', leftValue); // $('#watermarkContainer').css('bottom', topValue); // break; // case '4': // $('#watermarkContainer').css('right', leftValue); // $('#watermarkContainer').css('bottom', topValue); // break; // default: // break; // } } let beaconPlay = new BeaconAction({ appkey: "L28ONSCW39DV4ZR3", // 系统或项目id, 必填 versionCode: '2.11.1', //项目版本,选填 channelID: 'channel', //渠道,选填 openid: 'openid', // 用户id, 选填 reportUrl: '/__xh__/beacon.cmc.hebtv.com/logserver/analytics/upload?tp=js', // 上报URL, 必填 isDebug: false, // 是否开启实时联调, 默认关闭,选填 strictMode: false,//严苛模式开关, 打开严苛模式会主动抛出异常, 上线请务必关闭!!! delay: 1000, // 普通事件延迟上报时间(单位毫秒), 默认3000(3秒),选填 sessionDuration: 60 * 1000,// session变更时间间隔, 一个用户持续30分钟(默认值)没有任何上报则算另一次 session,每变更一次session上报一次启动事件(rqd_applaunched),使用毫秒,最小值30 }); function getLiveFor() { $.ajax({ url: 'https://api.cmc.hebrts.cn/cms/api/micro/live/seat/live?tenantId=0d91d6cfb98f5b206ac1e752757fc5a9&api_version=3.7.0&app_version=4.0.1&client=androids&cms_app_id=29&app_id=2&articleId=' + articleId, method: 'GET', success: function (res) { if (res.state == 200 || res.state == "200") { let data = res.data; let liveType = data.status; let wwidth = window.innerWidth > 680 ? 680 : window.innerWidth if (liveType == "0" || liveType == "2" || liveType == "3") { setTime = new Date(data.startTime.replace(/\-/g, '/')).getTime(); endTime = new Date(data.endTime.replace(/\-/g, '/')).getTime(); let liveimgIcon =data.imagepath || "https://www.hebrts.cn/public/img/noImg.jpg" if (setTime > nowTimeNew) { $(".time").show(); countDown(); timer=setInterval(countDown, 1000); $('#videoCon').prepend('页面跳转中...');} if (nowTimeNew == endTime) { let timeHtml='

直播已结束

'+data.endTime+'

'; $('#videoCon').html(timeHtml).prepend('暂无商品'); } } } } }) } //setInterval(getLiveFor, 30000); function getVideoType(url){ if (!url) return 'auto'; const extension = url.split('.').pop().toLowerCase().split('?')[0]; switch(extension) { case 'm3u8': case 'm3u': return 'customHls'; // HLS流使用自定义处理m3u8 case 'mp4': case 'webm': case 'ogg': case 'mov': return 'auto'; // 普通视频使用auto自适应配置 default: // 如果无法确定格式,先尝试HLS,失败后回退到auto return url.includes('m3u8') ? 'customHls' : 'auto'; } } var appList=[] function getLiveDetailNew() { $.ajax({ url: 'https://api.cmc.hebrts.cn/cms/api/micro/live/seat/live?tenantId=0d91d6cfb98f5b206ac1e752757fc5a9&api_version=3.7.0&app_version=4.0.1&client=androids&cms_app_id=29&app_id=2&articleId=' + articleId, method: 'GET', success: function (res) { if (res.state == 200 || res.state == "200") { let data = res.data; appList=JSON.parse(res.data.appCustomParams).liveHouse; if (!navigator.userAgent.includes("tx_jishi_activity")){ const sourceIdMap = { '全国广电新媒体联盟': 'key_1', '电视制作中心': 'key_2', '新媒体中心': 'key_3', '总编室': 'key_4', '技术管理中心': 'key_5', '广电影视公司': 'key_6', '新华社': 'key_7', '央视': 'key_8', '融媒体新闻中心': 'key_9', '通联中心': 'key_10', '传播策划中心': 'key_11', '精品中心': 'key_12', '融传通三中心(知河北)': 'key_13', '卫视频道(文化)': 'key_14', '经济生活频道(民生)': 'key_15', '公共频道(文旅)': 'key_16', '都市频道(健康)': 'key_17', '农民频道(乡村振兴)': 'key_18', '影视剧频道(美丽家庭)': 'key_19', '少儿科教频道(教育)': 'key_20', '新闻频率群(政务)': 'key_21', '生活频率群(生活)': 'key_22', '交通频率群(交通992)': 'key_23', '大型活动部': 'key_24', '营销管理中心(燕赵品牌)': 'key_25', '冀广传媒集团': 'key_26', '文旅体育': 'key_27', }; beacon.onDirectUserAction('page_loaded', { from_page_id:'', from_page_title:'', current_page_id:'11605049', current_page_title:document.title, ua:navigator.userAgent, cookie_id:generateTimestampedUUID(), url:window.locations.href, authorId: data.authorIdStr, authorNickName:data.authorNickName, catalog_id:data.catalogId, source_live:data.prop3, source_live_id: sourceIdMap[data.prop3], articleType:data.type, content_title:document.title,//内容标题 content_id:'11605049',//内容id content_spider_id:data.authorIdStr, //冀时号id content_spider_name:data.authorNickName, //冀时号名称 tag1: md5(generateHash(String(getTag1()))), tag4: md5(generateHash(String(getTag4()))) });; $(function() { window.qdt.setAccountInfo({ diy_id:{ cookie_id:generateTimestampedUUID(), }, }) window.qdt.track('page_loaded', { from_page_id:'', from_page_title:'', current_page_id:'11605049', current_page_title:document.title, ua:navigator.userAgent, cookie_id:generateTimestampedUUID(), url:window.locations.href, authorId: res.data.authorIdStr, authorNickName:res.data.authorNickName, catalog_id:res.data.catalogId, source_live:res.data.prop3, source_live_id: sourceIdMap[res.data.prop3], articleType:res.data.type, content_title:document.title,//内容标题 content_id:'11605049',//内容id content_spider_id:res.data.authorIdStr, //冀时号id content_spider_name:res.data.authorNickName, //冀时号名称 tag1: md5(generateHash(String(getTag1()))), tag4: md5(generateHash(String(getTag4()))) }); }); const startTime = new Date().getTime(); let counter = 0; function calculateDuration() { const endTime = new Date().getTime(); const duration = endTime - startTime; const seconds = Math.floor(duration / 1000); return { seconds: seconds, }; } setInterval(function() { const duration = calculateDuration(); counter++; // 每次间隔增加计数器 if (counter % 2 === 0) { beacon.onDirectUserAction('count_the_duration', { seconds: 60, // 固定上报60秒 url:window.locations.href, authorId:data.authorId, catalog_id:data.catalogId, articleType:data.type }); $(function() { window.qdt.track('count_the_duration', { seconds: 60, // 固定上报60秒 url:window.locations.href, authorId:data.authorId, catalog_id:data.catalogId, articleType:data.type }); }); } }, 30000); // 30秒检查一次 } if(appList.liveIntroduction == 'true'){ $('.mainCon .articleCon').html(data.textIntro) } $(document).ready(function() { const navItems = $('.nav .navItem'); const config = { liveIntroduction: { key: 'liveIntroduction', titleKey: 'liveIntroductionTitle', defaultTitle: '直播介绍', index: 0 }, liveTeletext: { key: 'liveTeletext', titleKey: 'liveTeletextTitle', defaultTitle: '直播', index: 1 }, chatInteraction: { key: 'chatInteraction', titleKey: 'chatInteractionTitle', defaultTitle: '实时评论', index: 2 } }; const visibleTabs = []; $.each(config, (key, tab) => { const navItem = navItems.eq(tab.index); if (appList[tab.key] === 'true') { navItem.text(appList[tab.titleKey] || tab.defaultTitle); navItem.show(); visibleTabs.push(navItem); } else { navItem.hide(); } }); // 判断默认选择的tab if (visibleTabs.length > 0) { const liveTeletextTab = visibleTabs.find(tab => tab.text() === '直播'); if (liveTeletextTab) { liveTeletextTab.addClass('active').siblings().removeClass('active'); $('.mainItem').eq(liveTeletextTab.index()).addClass('active').siblings().removeClass('active'); liveTeletextTab.trigger('click'); } else { visibleTabs[0].addClass('active').siblings().removeClass('active'); $('.mainItem').eq(visibleTabs[0].index()).addClass('active').siblings().removeClass('active'); visibleTabs[0].trigger('click'); } } }); offvr = res.data.vrLiveFlag $(".articleTitle .title").html(data.title); share_title = data.title; if (liveMore.length > 0) { data=liveMore[0]; } let liveType = data.status; livesStatus = data.status; let wwidth = window.innerWidth > 500 ? 500 : window.innerWidth console.log('=============', data) if (!data.livePath && !data.pclivePath) { console.log('=============', data) //$('.nav .navItem').eq(1).addClass('active').siblings().removeClass('active')// 默认选中图文直播 //$('.mainItem').eq(1).addClass('active').siblings().removeClass('active')// 默认选中图文直播 droploader.unlock(); droploader.noData(false); $('.mainCon .dropload-down').show(); navIndex = 1 //getLiveFn(droploader); } if(data.audioUrl){ $("#audio").attr("src",data.audioUrl); } if (liveType == "0" || liveType == "2") { setTime = new Date(data.liveSeatStartTime.replace(/\-/g, '/')).getTime(); endTime = new Date(data.liveSeatEndTime.replace(/\-/g, '/')).getTime(); let liveimgIcon =data.imagepath || "https://www.hebrts.cn/public/img/noImg.jpg" if (setTime > nowTimeNew) { $(".time").show(); countDown(); timer=setInterval(countDown, 1000); $('#videoCon').prepend('' + talkObj.title ');} if (nowTimeNew > endTime) { let timeHtml='

直播已结束

'+data.liveSeatEndTime+'

'; $('#videoCon').html(timeHtml).prepend('意甲官方冠名赞助商出任热刺官方合作伙'); } } else if (liveType == "3") { if (!data.livePath && !data.pclivePath && !data.playbackUrl) { $('#videoCon').prepend('意甲官方冠名赞助商出任热刺官方合作伙伴'); } else { $('#videoCon').css('height', wwidth / 16 * 9); data.livePath = data.playbackUrl; let playUrl=data.livePath; if(data.livePath.indexOf('/__xh__/tv.pull.hebtv.com/')!=-1){ playUrl=linkToMd5(data); } dp = new DPlayer({ container: document.getElementById('videoCon'), autoplay: false, video: { url: playUrl, pic: data.imagepath, type: getVideoType(playUrl), //修复谷歌浏览器播放直播偶先视频加载失败 auto ->customHls/hls customType: { customHls: function (video, player) { if (Hls.isSupported()) { const hls = new Hls(); hls.loadSource(video.src); // console.log(video.src, 'video.srcvideo.srcvideo.src') hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED, function () { video.play(); }); } else if (video.canPlayType('application/vnd.apple.mpegurl')) { video.src = video.src; video.addEventListener('loadedmetadata', function () { video.play(); }); } } } } }); dp.on('canplay', function () { $('.dplayer-video').attr({ "x5-video-player-type": "h5", "x5-video-player-fullscreen": "true", "x5-video-orientation": "portrait" }); }); dp.on('pause', function () { console.log("单子机位直播回看暂停上报1",res.data) let currentTime = dp.video.currentTime; beaconPlay.onDirectUserAction('pause_play_video', { video_id:'', content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id segment_id:"", segment_title:"", segment_type:"", block_position:"", played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_source:"", content_author_name:"", }); $(function() { window.qdt.track('pause_play_video', { video_id:'', content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id segment_id:"", segment_title:"", segment_type:"", block_position:"", played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_source:"", content_author_name:"", }); }); $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); }); dp.on('error', function () { // $("#liveNum" + liveNum + ' .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/publicV2/imgs/huan.png'); }); dp.on('play', function () { //直播播放埋点 let currentTime = dp.video.currentTime; beaconPlay.onDirectUserAction('play_video', { video_id:'', content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id segment_id:"", segment_title:"", segment_type:"", block_position:"", start_position:currentTime.toFixed(2),//播放的起始位置,默认为0 content_source:"", content_author_name:"", }); $(function() { window.qdt.track('play_video', { video_id:'', content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id segment_id:"", segment_title:"", segment_type:"", block_position:"", played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_source:"", content_author_name:"", }); }); $(".dplayer-notice").css("opacity", '0'); //直播回看添加水印 if (!isImageAdded && data.watermarkImage) { var positionStyles = { '1': { top: '2%', left: '1%' }, '2': { top: '2%', right: '1%' }, '3': { bottom: '3%', left: '1%' }, '4': { bottom: '3%', right: '1%' } }; var position = data.watermarkImagePosition || '1'; var styles = positionStyles[position]; if (styles) { var newDiv = $('
'); newDiv.prepend('意甲官方冠名赞助商'); newDiv.css(styles); $('.videoCon').append(newDiv); isImageAdded = true; } } if (liveNum) { $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $("#liveNum" + liveNum + ' .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); } else { $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $('#liveNum0 .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); } setTimeout(function () { $('#videoCon').addClass("dplayer-hide-controller"); }, 3000); }); // 监听全屏状态改变事件 document.addEventListener('fullscreenchange', function () { if (document.fullscreenElement) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); //Firefox document.addEventListener('mozfullscreenchange', function () { if (document.mozfullscreenchange) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); //如Chrome和Safari document.addEventListener('webkitfullscreenchange', function () { if (document.webkitfullscreenchange) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); setInterval(function () { if ($("#videoCon").attr('class').indexOf('dplayer-playing') > 0 && $("#videoCon").attr('class').indexOf('dplayer-hide-controller') < 0) { setTimeout(function () { $('#videoCon').addClass("dplayer-hide-controller"); }, 3000); } }, 2500); } } else { endTime = new Date(data.liveSeatEndTime.replace(/\-/g, '/')).getTime(); countDown(); timer=setInterval(countDown, 1000); if (!data.livePath && !data.pclivePath && !data.playbackUrl) { $('#videoCon').prepend('直播倒计时'); } else { data.livePath = data.livePath ? data.livePath : data.pclivePath || data.playbackUrl; //data.livePath=data.livePath?data.livePath:data.playbackUrl; $('#videoCon').css('height', wwidth / 16 * 9); let playUrl=data.livePath; if(data.livePath.indexOf('/__xh__/tv.pull.hebtv.com/')!=-1){ playUrl=linkToMd5(data); } if (offvr == 1) { // vrPlayer = new CmnVRPlayer('videoCon', { // autoplay: true, // 是否自动播放 选填 默认false // muted: true, // 是否静音 选填 默认false // poster: data.imagepath, // 封面图 选填 // url: playUrl, // 视频/直播地址 必填 // initVoice: 0, // 初始音量 选填 默认0.3 取值范围0-1 // isOpenReturn: false, // 是否开启回正 选填 默认false // isOpenGyro: false, // 是否开启陀螺仪 选填 默认true // isOpenVRmode: false //为true的话 播放器右下角会出现VR分屏的按钮 // }) const vrPlayer = createOptimizedVRPlayer({ playUrl: playUrl, containerId: 'videovr', poster: data.imagepath, wwidth: wwidth, offvr: offvr, onPlay: function() { }, onPause: function() { }, onError: function(error) { console.error("VR播放器错误:", error); } }); }else{ dp = new DPlayer({ container: document.getElementById('videoCon'), autoplay: false, video: { url: playUrl, pic: data.imagepath, type: getVideoType(playUrl), //修复谷歌浏览器播放直播偶先视频加载失败 auto ->customHls/hls customType: { customHls: function (video, player) { if (Hls.isSupported()) { const hls = new Hls(); hls.loadSource(video.src); // console.log(video.src, 'video.srcvideo.srcvideo.src') hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED, function () { video.play(); }); } else if (video.canPlayType('application/vnd.apple.mpegurl')) { video.src = video.src; video.addEventListener('loadedmetadata', function () { video.play(); }); } } } } }); dp.on('pause', function () { console.log("单子机位直播暂停上报",data) let currentTime = dp.video.currentTime; beaconPlay.onDirectUserAction('pause_play_video', { content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id video_id:'', segment_id:"", segment_title:"", segment_type:"", block_position:"", content_author_name:"", }); $(function() { window.qdt.track('pause_play_video', { video_id:'', content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id segment_id:"", segment_title:"", segment_type:"", block_position:"", played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_source:"", content_author_name:"", }); }); //$(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); }); dp.on('canplay', function () { if(data.audioUrl){ $("#audio").get(0).play(); } $('.dplayer-video').attr({ "x5-video-player-type": "h5", "x5-video-player-fullscreen": "true", "x5-video-orientation": "portrait" }); }); $(".dplayer-bar-wrap").hide(); $(".dplayer-time").hide(); $(".dplayer-mobiles-play").click(function(){ if(data.audioUrl){ $("#audio").get(0).play(); } }); dp.on('play', function () { $(".dplayer-notice").css("opacity", '0'); console.log("单子机位直播播放上报",data) //直播播放埋点 let currentTime = dp.video.currentTime; beaconPlay.onDirectUserAction('play_video', { content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 start_position:currentTime.toFixed(2),//播放的起始位置,默认为0 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id video_id:'', segment_id:"", segment_title:"", segment_type:"", block_position:"", content_author_name:"", }); $(function() { window.qdt.track('play_video', { video_id:'', content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id segment_id:"", segment_title:"", segment_type:"", block_position:"", played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_source:"", content_author_name:"", }); }); //直播回看添加水印 if (!isImageAddedTwo && data.watermarkImage) { var positionStyles = { '1': { top: '2%', left: '1%' }, '2': { top: '2%', right: '1%' }, '3': { bottom: '3%', left: '1%' }, '4': { bottom: '3%', right: '1%' } }; var position = data.watermarkImagePosition || '1'; var styles = positionStyles[position]; if (styles) { var newDiv = $('
'); newDiv.prepend('0 天 0 时 0 分 0 秒'); newDiv.css(styles); $('.videoCon').append(newDiv); isImageAddedTwo = true; } } if (liveNum) { $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $("#liveNum" + liveNum + ' .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); } else { $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $('#liveNum0 .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); } setTimeout(function () { $('#videoCon').addClass("dplayer-hide-controller"); }, 3000); }); // 监听全屏状态改变事件 document.addEventListener('fullscreenchange', function () { if (document.fullscreenElement) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); //Firefox document.addEventListener('mozfullscreenchange', function () { if (document.mozfullscreenchange) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); //如Chrome和Safari document.addEventListener('webkitfullscreenchange', function () { if (document.webkitfullscreenchange) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); dp.on('error', function () { console.log(liveNum); //$("#liveNum" + liveNum + ' .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/publicV2/imgs/huan.png'); }); setInterval(function () { if ($("#videoCon").attr('class').indexOf('dplayer-playing') > 0 && $("#videoCon").attr('class').indexOf('dplayer-hide-controller') < 0) { setTimeout(function () { $('#videoCon').addClass("dplayer-hide-controller"); }, 3000); } }, 2500); var isMobile = !!navigator.userAgent.match(/AppleWebKit.*mobiles.*/); if (isMobile) { //全屏事件 dp.on('fullscreen', function () { screen.orientation.lock("landscape"); }); //退出全屏事件 dp.on('fullscreen_cancel', function () { screen.orientation.unlock(); }); } } } } share_summary = res.data.intro; if (share_summary && share_summary.indexOf('\n') != -1) { let html = '' let cnt = '' let arr = share_summary.split('\n') for (var i = 0; i < arr.length; i++) { let item = arr[i]; cnt += '

' + item + '

' } html = '
' + cnt + '
' $('.mainCon .articleCon').html(data.textIntro) } templateSDK.wx_share({ share_title: share_title, share_logo: share_logo, share_summary: share_summary }); // 微直播直播间装修 let styles=JSON.parse(res.data.appCustomParams).liveHouse.liveTheme; let stylebg1="https://pic.cmc.hebrts.cn/0/0d91d6cfb98f5b206ac1e752757fc5a9/2024/11/13/03f61de0a17011ef85beca2361d0b397.png" let stylebg2="https://pic.cmc.hebrts.cn/0/0d91d6cfb98f5b206ac1e752757fc5a9/2024/11/13/03f65ce2a17011ef85beca2361d0b397.png" let stylebg3="https://pic.cmc.hebrts.cn/0/0d91d6cfb98f5b206ac1e752757fc5a9/2024/11/13/03fa83a8a17011ef85beca2361d0b397.png" let stylebg4="https://pic.cmc.hebrts.cn/0/0d91d6cfb98f5b206ac1e752757fc5a9/2024/11/13/7fe37e7aa19811ef85beca2361d0b397.png" let backgroundImage = ''; if(styles){ if(styles === 'style0'){ }else{ if (styles === 'style1') { backgroundImage = stylebg1; } else if (styles === 'style2') { backgroundImage = stylebg2; } else if (styles === 'style3') { backgroundImage = stylebg3; }else{ backgroundImage = stylebg4; } if (backgroundImage) { $('body').css({ 'margin': '0', 'height': '100vh', 'background': 'url(' + backgroundImage + ') no-repeat center center fixed', 'background-size': 'cover', }); } $('*').css('color', 'white'); $('.navCon').css('background', 'none'); $('.comment').css('background', 'none'); $('#editWrap').css('color', 'white !important'); setTimeout(function() { $('.comment .item .userImg p').css('color', 'white'); }, 500); } } } } }) } // 加载图文直播 var livePage = 1, firstLive = true; $(function () { droploader = $('.mainCon').dropload({ scrollArea: window, domDown: { domNoData: '
暂无更多数据
', }, loadUpFn: function (me) { if (navIndex == 1) { livePage = 1; getLiveFn(me) } else if (navIndex == 2) { commentPage = 1; getCommentFn(droploader); } }, loadDownFn: function (me) { // getLiveFn(me) if (navIndex == 0) { $('.mainCon .dropload-down, .mainCon .dropload-up').hide(); } if (navIndex == 1) { getLiveFn(me) } else if (navIndex == 2) { getCommentFn(me); }; }, threshold: 70 }) }) var itemidx = -1 function getLiveFn(me) { templateSDK.getLiveDetail({ articleId: articleId, pageNum: livePage, pageSize: 99 }, function (res) { if (res.status == 200) { const data = res.data; let wwidth = window.innerWidth > 500 ? 500 : window.innerWidth if (livePage === 1 && firstLive) { firstLive = false; } if (data.total) { var html = ''; for (var jj = 0; jj < data.lives.length; jj++) { let item = data.lives[jj]; var text = '', imgs = '', videos = ''; if (item.type == 1 && item.imagepath) { var imgArr = item.imagepath.split(','); if (imgArr.length > 1) { if (imgArr.length == 4 || imgArr.length == 2) { for (var i = 0; i < imgArr.length; i++) { let item = imgArr[i]; imgs += '预约 .wx-btn { borde' } } else { for (var i = 0; i < imgArr.length; i++) { let item = imgArr[i]; imgs += 'background' } } } else { for (var i = 0; i < imgArr.length; i++) { let item = imgArr[i]; imgs += 'transparent' } } } if (item.type == 2) { videos += ''; } if (item.type == 5) { text =`

${item.content.replace(/\n/g,"
")}

`; } else { text = item.content.replace(/\n/g,"
"); } itemidx+=1 var mma = itemidx let avatar = item.avatar || ''; html += ('
' + '
' + '
' + '
' + '
' + '
冀时新闻
' + '
' + templateSDK.dateFormatAddCalc({ date: item.publishtime, format: 'YYYY-MM-DD HH:mm' }) + '
' + '
' + '
' + '

' + text + '

' +'
' +'
...
' +`
展开
` +'
' + '
' + (imgs ? '
' + imgs + '
' : '') + (videos ? '
' + videos + '
' : '') + '
' + '
' ); }; if (livePage === 1) { $('.liveConDom').html(html); conceal() } else { $('.liveConDom').append(html); //yang:暂时请求99数据,不做添加处理 ,是否需要再 判断加载livePage > data.pageSum 进行 me.lock('down') 拦截 conceal() } $('.liveConDom video').attr({ "x5-video-player-type": "h5", "x5-video-player-fullscreen": "true", "x5-video-orientation": "portrait" }) $('.liveConDom a').removeAttr('href'); // 是否还有更多 if (livePage > data.pageSum) { me.noData(); } } if (data.lives.length) { livePage++; me.resetload(); } else { me.resetload(); me.noData(); me.lock('down') } } else { me.noData() }; if (isWX()) { imginfo(); } }); } //修改选中的机位 function changeSeat(num) { clearInterval(timer) nowTimeNew = new Date(getLocalTime()).getTime(); let wwidth = window.innerWidth > 500 ? 500 : window.innerWidth liveNum = parseInt(num); $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $("#liveNum" + num + ' .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); $('.liveP').each((i, item) => { $(item).html($(item).text()); }) if($("#liveWord"+num).text().length>7){ $("#liveWord"+num).html(''+$("#liveWord"+num).html()+'') } let data = liveMore[num]; console.log(data.status,'状态') if(liveMore[0].audioUrl){ $("#audio").get(0).play(); } if (data.status == "0" || data.status == "2") { setTime = new Date(data.liveSeatStartTime.replace(/\-/g, '/')).getTime(); endTime = new Date(data.liveSeatEndTime.replace(/\-/g, '/')).getTime(); let liveimgIcon =data.imagepath || "https://www.hebrts.cn/public/img/noImg.jpg" if (setTime > nowTimeNew) { $(".time").show(); dp && dp.destroy() countDown(); timer=setInterval(countDown, 1000); let timeHtml = `

直播倒计时

0000

预约

`; $('#videoCon').html(timeHtml).prepend('width'); } if (nowTimeNew >= endTime) { dp && dp.destroy() let timeHtml='

直播已结束

'+data.liveSeatEndTime+'

'; $('#videoCon').html(timeHtml).prepend('100%'); } } else if (data.status == "3") { document.addEventListener('fullscreenchange', function () { if (document.fullscreenElement) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); //Firefox document.addEventListener('mozfullscreenchange', function () { if (document.mozfullscreenchange) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); //如Chrome和Safari document.addEventListener('webkitfullscreenchange', function () { if (document.webkitfullscreenchange) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); dp && dp.destroy() if (!data.livePath && !data.playbackUrl) { $('#videoCon').prepend('height'); } else { $('#videoCon').css('height', wwidth / 16 * 9); data.livePath = data.playbackUrl; let playUrl=data.livePath; if(data.livePath.indexOf('/__xh__/tv.pull.hebtv.com/')!=-1){ playUrl=linkToMd5(data); } dp = new DPlayer({ container: document.getElementById('videoCon'), autoplay: false, video: { url: playUrl, pic: data.imagepath, type: getVideoType(playUrl), //修复谷歌浏览器播放直播偶先视频加载失败 auto ->customHls/hls customType: { customHls: function (video, player) { if (Hls.isSupported()) { const hls = new Hls(); hls.loadSource(video.src); // console.log(video.src, 'video.srcvideo.srcvideo.src') hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED, function () { video.play(); }); } else if (video.canPlayType('application/vnd.apple.mpegurl')) { video.src = video.src; video.addEventListener('loadedmetadata', function () { video.play(); }); } } } } }); dp.play(); dp.on('canplay', function () { $('.dplayer-video').attr({ "x5-video-player-type": "h5", "x5-video-player-fullscreen": "true", "x5-video-orientation": "portrait" }); }); dp.on('pause', function () { console.log("多机位直播回看暂停上报",data) let currentTime = dp.video.currentTime; beaconPlay.onDirectUserAction('pause_play_video', { content_type:"live_record",//视频所属内容的类型 content_id:data.articleId,//稿件id content_title:data.title,//稿件标题 played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id video_id:'', segment_id:"", segment_title:"", segment_type:"", block_position:"", content_author_name:"", }); $(function() { window.qdt.track('pause_play_video', { video_id:'', content_type:"live_record",//视频所属内容的类型 content_id:res.data.articleId,//稿件id content_title:res.data.title,//稿件标题 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id segment_id:"", segment_title:"", segment_type:"", block_position:"", played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_source:"", content_author_name:"", }); }); //$(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); }); dp.on('error', function () { // $("#liveNum" + liveNum + ' .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/publicV2/imgs/huan.png'); }); var changeIsImage = false; dp.on('play', function () { $(".dplayer-notice").css("opacity", '0'); console.log("多机位回看播放上报") //直播播放埋点 let currentTime = dp.video.currentTime; beaconPlay.onDirectUserAction('play_video', { content_type:"live_record",//视频所属内容的类型 content_id:data.articleId,//稿件id content_title:data.title,//稿件标题 start_position:currentTime.toFixed(2),//播放的起始位置,默认为0 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id video_id:'', segment_id:"", segment_title:"", segment_type:"", block_position:"", content_author_name:"", }); $(function() { window.qdt.track('pause_play_video', { content_type:"live_record",//视频所属内容的类型 content_id:data.articleId,//稿件id content_title:data.title,//稿件标题 start_position:currentTime.toFixed(2),//播放的起始位置,默认为0 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id video_id:'', segment_id:"", segment_title:"", segment_type:"", block_position:"", content_author_name:"", }); }); //直播回看添加水印 if (data.watermarkImage) { var positionStyles = { '1': { top: '2%', left: '1%' }, '2': { top: '2%', right: '1%' }, '3': { bottom: '3%', left: '1%' }, '4': { bottom: '3%', right: '1%' } }; var position = data.watermarkImagePosition || '1'; var styles = positionStyles[position]; if (styles) { var newDiv = $('
'); newDiv.prepend('50px'); newDiv.css(styles); $('.videoCon').append(newDiv); } } if (liveNum) { $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $("#liveNum" + liveNum + " .liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); } else { $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $('#liveNum0 .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); } setTimeout(function () { $('#videoCon').addClass("dplayer-hide-controller"); }, 3000); }); setInterval(function () { if ($("#videoCon").attr('class').indexOf('dplayer-playing') > 0 && $("#videoCon").attr('class').indexOf('dplayer-hide-controller') < 0) { setTimeout(function () { $('#videoCon').addClass("dplayer-hide-controller"); }, 3000); } }, 2500); } } else { endTime = new Date(data.liveSeatEndTime.replace(/\-/g, '/')).getTime(); countDown(); timer=setInterval(countDown, 1000); if (!data.livePath && !data.pclivePath) { dp&&dp.destroy() $('#videoCon').prepend('关闭'); } else { if (offvr == 1) { $('#videovr').html(`

直播倒计时

0 0 0 0

预约

`) let playUrl=data.livePath; if(data.livePath.indexOf('/__xh__/tv.pull.hebtv.com/')!=-1){ playUrl=linkToMd5(data); } vrPlayer && vrPlayer.destroyPlayer(['videoCon']) // vrPlayer = new CmnVRPlayer('videoCon', { // autoplay: true, // 是否自动播放 选填 默认false // muted: true, // 是否静音 选填 默认false // poster: data.imagepath, // 封面图 选填 // url: playUrl, // 视频/直播地址 必填 // initVoice: 0, // 初始音量 选填 默认0.3 取值范围0-1 // isOpenReturn: false, // 是否开启回正 选填 默认false // isOpenGyro: false, // 是否开启陀螺仪 选填 默认true // isOpenVRmode: false //为true的话 播放器右下角会出现VR分屏的按钮 // }) const vrPlayer = createOptimizedVRPlayer({ playUrl: playUrl, containerId: 'videovr', poster: data.imagepath, wwidth: wwidth, offvr: offvr, onPlay: function() { }, onPause: function() { }, onError: function(error) { console.error("VR播放器错误:", error); } }); }else{ document.addEventListener('fullscreenchange', function () { if (document.fullscreenElement) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); //Firefox document.addEventListener('mozfullscreenchange', function () { if (document.mozfullscreenchange) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); //如Chrome和Safari document.addEventListener('webkitfullscreenchange', function () { if (document.webkitfullscreenchange) { $('#watermarkContainerimg').css('display', 'none'); console.log('进入全屏'); } else { $('#watermarkContainerimg').css('display', 'block'); } }); dp&&dp.destroy() data.livePath = data.livePath ? data.livePath : data.pclivePath; //data.livePath=data.livePath?data.livePath:data.playbackUrl; $('#videoCon').css('height', wwidth / 16 * 9); let playUrl=data.livePath; if(data.livePath.indexOf('/__xh__/tv.pull.hebtv.com/')!=-1){ playUrl=linkToMd5(data); } dp = new DPlayer({ container: document.getElementById('videoCon'), autoplay: false, video: { url: playUrl, pic: data.imagepath, type: getVideoType(playUrl), //修复谷歌浏览器播放直播偶先视频加载失败 auto ->customHls/hls customType: { customHls: function (video, player) { if (Hls.isSupported()) { const hls = new Hls(); hls.loadSource(video.src); // console.log(video.src, 'video.srcvideo.srcvideo.src') hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED, function () { video.play(); }); } else if (video.canPlayType('application/vnd.apple.mpegurl')) { video.src = video.src; video.addEventListener('loadedmetadata', function () { video.play(); }); } } } } }); dp.play(); dp.on('pause', function () { console.log("多机位直播暂停上报",data) let currentTime = dp.video.currentTime; beaconPlay.onDirectUserAction('pause_play_video', { content_type:"live_record",//视频所属内容的类型 content_id:data.articleId,//稿件id content_title:data.title,//稿件标题 played_time:currentTime.toFixed(2),//播放的起始位置,默认为0 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id video_id:'', segment_id:"", segment_title:"", segment_type:"", block_position:"", content_author_name:"", //$(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); }); //$(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); }); dp.on('canplay', function () { if(liveMore[0].audioUrl){ $("#audio").get(0).play(); } $('.dplayer-video').attr({ "x5-video-player-type": "h5", "x5-video-player-fullscreen": "true", "x5-video-orientation": "portrait" }); }); $(".dplayer-bar-wrap").hide(); $(".dplayer-time").hide(); if(liveMore[0].audioUrl){ $("#audio").get(0).play(); } var changeIsImageTwo = false; dp.on('play', function () { console.log("多机位直播播放上报") //直播播放埋点 let currentTime = dp.video.currentTime; beaconPlay.onDirectUserAction('play_video', { content_type:"live_record",//视频所属内容的类型 content_id:data.articleId,//稿件id content_title:data.title,//稿件标题 start_position:currentTime.toFixed(2),//播放的起始位置,默认为0 content_author_id:data.addUser,//内容的作者 current_page_title:data.title,//当前页名称 current_page_id:data.articleId,//当前页id video_id:'', segment_id:"", segment_title:"", segment_type:"", block_position:"", content_author_name:"", }); //直播回看添加水印 if (data.watermarkImage) { var positionStyles = { '1': { top: '2%', left: '1%' }, '2': { top: '2%', right: '1%' }, '3': { bottom: '3%', left: '1%' }, '4': { bottom: '3%', right: '1%' } }; var position = data.watermarkImagePosition || '1'; var styles = positionStyles[position]; if (styles) { var newDiv = $('
'); newDiv.prepend('${data.msg.nickNam'); newDiv.css(styles); $('.videoCon').append(newDiv); } } if(liveMore[0].audioUrl){ $("#audio").get(0).play(); } $(".dplayer-notice").css("opacity", '0'); if (liveNum) { $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $("#liveNum" + liveNum + ' .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); } else { $(".liveIcon").attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/play.png'); $('#liveNum0 .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/share/dplayer/playing.png'); } setTimeout(function () { $('#videoCon').addClass("dplayer-hide-controller"); }, 3000); }); dp.on('error', function () { console.log(liveNum); // $("#liveNum" + liveNum + ' .liveIcon').attr('src', 'https://web.cmc.hebrts.cn/cms/rmt0336/publicV2/imgs/huan.png'); }); setInterval(function () { if ($("#videoCon").attr('class').indexOf('dplayer-playing') > 0 && $("#videoCon").attr('class').indexOf('dplayer-hide-controller') < 0) { setTimeout(function () { $('#videoCon').addClass("dplayer-hide-controller"); }, 3000); } }, 2500); var isMobile = !!navigator.userAgent.match(/AppleWebKit.*mobiles.*/); if (isMobile) { //全屏事件 dp.on('fullscreen', function () { screen.orientation.lock("landscape"); }); //退出全屏事件 dp.on('fullscreen_cancel', function () { screen.orientation.unlock(); }); } } } } } function conceal(){ var content = document.getElementsByClassName('webkit3') for (var en = 0; en < content.length; en++) { let dom = content[en] let enn =en if (dom.clientHeight < dom.scrollHeight ) { $('.morebox').eq(enn).css("display", "block") $('.morebox').eq(enn).attr('steta',"true") }else{ $('.morebox').eq(enn).css("display", "none") //$('.morebox').eq(enn).attr('steta',"flase") } if($('.morebox').eq(enn).attr('steta') == "true"){ $('.morebox').eq(enn).css("display", "block") } } } function showUp(idx) { if ($(".fold").eq(idx).text() == "展开") { $('.morebox').eq(idx).removeClass('more') $('.webkit3').eq(idx).addClass('all_text') $(".ellipsis").eq(idx).css("display", "none") $(".fold").eq(idx).text("收起") } else { $('.morebox').eq(idx).addClass('more') $('.webkit3').eq(idx).removeClass('all_text') $(".ellipsis").eq(idx).css("display", "block") $(".fold").eq(idx).text("展开") } } let commentPage = 1; function getCommentFn(me) { templateSDK.getCommentList({ relaId: articleId, pageSize: 10, page: commentPage }, function (res) { if (res && res.status == '200') { var data = res.data, commentArr = data.pageRecords, html = ''; $('.liveComment .commentCount span').text(data.totalRecords); var articleTitleColor = $('.articleTitle').css('color'); for (var i = 0; i < commentArr.length; i++) { let item = commentArr[i]; var contentstyle=""; if (articleTitleColor === 'rgb(255, 255, 255)') { contentstyle="color: white;"; } html += ('
' + '
' + ' ${data.msg.content ' + '

' + item.nickName + ':

' + '
' + '
' + '
' + item.content + '
' + '
' + '
' ); }; commentPage == 1 ? $('.comment').html(html) : $('.comment').append(html); if (commentPage >= data.pageCount) { me.noData(); } } commentArr.length && commentPage++; me.resetload(); }) } // 打开app $('body').on('click', '.launch', function () { templateSDK.openApp(); }) // 微信分享

栏目速览

本页围绕「意甲官方冠名赞助商出任热刺官方合作伙伴」梳理公开信息,便于对照栏目动态与后续阅读。

移动端与电脑端入口保持一致。如某条暂不可用,可改走栏目列表继续查找。

列表适合快速定位,正文适合核对表述。两者都保留在站内即可形成完整阅读路径。

栏目入口

网站首页 · 9mrgrgklm · 立即购买1

本站内容按公开信息整理,栏目与正文互为入口,便于对照阅读。