文章内容:
Lupa.cz » Vydavatel hry ze světa Pána prstenů otevírá v Praze nové vývojářské herní studio 作者:North Beach Games
V Česku oevírá vývojové centrum další herní studio。参加 North Beach Games 活动的所有活动都与此无关。 Kanceláře budou v Praze,další spolupracovníci budou dělat na dálku。
托马斯·普塞尼卡 (Tomáš Pšenička) 与 Keen Software House 的太空工程师 Sam Edwards 合作开发了这款软件。十次搁浅深海模拟在热带地区进行。
Space Engineers i Stranded Deep 游戏是一款沙盒生存游戏。 V Praze se proto aktuálně má dělat na Stranded Deep 2.
北滩运动会即将举办。 《Kromě Stranded Deep》、《7 Days to Die》、《The Fun Pimps》、《The Lord of the Rings: Return to Moria》和《Free Range Games》。
Našli 只是 článku chybu?Lupa.cz 记者 E15。 O technology píše take do zahraničních médií。
]]> `; 如果 (youtubeIframe !== null && iinfoVastUrls.length > 0) { const re = /embed\/(.*)\?/; const youtubeId = youtubeIframe.src.match(re)[1]; const youtubeImg = 'https://img.youtube.com/vi/' + youtubeId + '/hqdefault.jpg'; 让 thumbWrap = ` `;thumbWrap += ` `thumbWrap += ``; youtubeIframe.after(document.createRange().createContextualFragment(thumbWrap)); youtubeIframe.style.display = 'none'; const youtubeThumb = document.getElementById('ytPrerollThumb') let prerollAdInitialized = false; document .addEventListener('DOMContentLoaded', handleInitScroll, false); window.addEventListener('scroll', handleInitScroll, false); 函数 handleInitScroll() { if (prerollAdInitialized === false) { const containerOffset = document.getElementById('ytPrerollThumb') .getBoundingClientRect(); const windowHeight = window.innerHeight; if (containerOffset.top 0.0) { prerollAdInitialized = true; console.log('预卷:INIT'); setTimeout(() => { youtubeThumb.remove(); playPrerollAd(); }, 2000); document.removeEventListener('DOMContentLoaded', handleInitScroll, false); window.removeEventListener('scroll', handleInitScroll, false); } } } } 让 adsManager; 让 adsLoader; 让 adDisplayContainer; 让 iinfoPrerollPosition; 让 iinfoVastUrlIndex = 0; 让 iinfoVastUrlIndexMuted = 0; 让 prerollCurrent = 0; 让 adVolume = 0; 让 prerollWidth = 480; 让 prerollHeight = 320; 让 prerollDocument; 让 videoContent;让 prerollLastError = 303; 让 prerollContainer; 让 prerollPaused = false; 函数 playPrerollAd() { youtubeIframe.after(document.createRange().createContextualFragment(videoEl)); iinfoPrerollPosition = document.getElementById('iinfoPrerollPosition'); document.getElementById('preroll-iframe').srcdoc = ''; document.getElementById('preroll-iframe').onload = function () { setupIframe(); } prerollContainer = document.getElementsByClassName('preroll-container-iframe')[0]; } 函数 setupIframe() { prerollDocument = document.getElementById('preroll-iframe').contentWindow.document; 让 el = prerollDocument.createElement('style' ); 预卷Document.head.appendChild(el); el.innerText = "#adContainer>div:nth-of-type(1),#adContainer>div:nth-of-type(1) > iframe { 宽度:99% !important;高度:99% !important;max -宽度:100%;}#videoContent,body{宽度:100vw;高度:100vh}body{font-family:'Helvetica Neue',Arial,sans-serif}#videoContent{溢出:隐藏;背景:#000}# adMuteBtn{宽度:35px;高度:35px;边框:0;背景:0 0;显示:无;位置:绝对;填充:rgba(230,230,230,1);底部:20px;右:25px}”;videoContent = prerollDocument。获取元素的 ID('内容元素'); videoContent.style.display = 'none'; videoContent.volume = 1; videoContent.muted = false; const playPromise = videoContent.play(); if (playPromise !== undefined) { playPromise.then(function () { console. log('允许PREROLL声音'); setUpIMA(true); }).catch(function () { console.log('禁止PREROLL声音'); videoContent.volume = 0; videoContent.muted = true; setUpIMA(false) ; }); } } 函数setUpDimensions() { prerollWidth = Math.min(iinfoPrerollPosition.offsetWidth, 480); prerollHeight = Math.min(iinfoPrerollPosition.offsetHeight, 320); } 函数setUpIMA(sound) { google.ima.settings.设置DisableCustomPlaybackForIOS10Plus(true); google.ima.settings.setLocale('cs'); google.ima.settings.setNumRedirects(10); // 创建广告展示容器。createAdDisplayContainer(); // 创建广告加载器。adsLoader = new google.ima.AdsLoader (adDisplayContainer); // 监听并响应广告加载和错误事件。 adsLoader.addEventListener( google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, onAdsManagerLoaded, false); adsLoader.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, onAdError , false); // 一个事件监听器,用于告诉 SDK 我们的内容视频 // 已完成,因此 SDK 可以播放任何后贴片广告。 const contentEndedListener = function () { adsLoader.contentComplete(); }; videoContent.onended = contentEndedListener; // 请求视频广告。 const adsRequest = new google.ima.AdsRequest(); /*adsRequest.adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?' + 'iu=/21775744923/external/single_preroll_skippable&sz=640x480&' + 'ciu_szs=300x250%2C728x90&gdfp_req=1&' + '输出=vast&unviewed_position_start=1&env=vp&impl=s&correlator=';*/ adsRequest.adTagUrl = iinfoVastUrls[iinfoVastUrlIndex]; if (sound) { adsRequest.adTagUrl = iinfoVastUrls[iinfoVastUrlIndex]; console.log('前贴片广告:' + iinfoVastUrls[iinfoVastUrlIndex] (英文): prerollCurrent = 0; videoContent.muted = false; videoContent.volume = 1; } else { adsRequest.adTagUrl = iinfoVastUrlsMuted[iinfoVastUrlIndexMuted]; console.log('前贴片广告:' + iinfoVastUrlsMuted[iinfoVastUrlIndexMuted]); prerollCurrent = 1; videoContent. muted = true; videoContent.volume = 0; } // 指定线性和非线性广告位大小。这有助于 SDK // 在返回多个广告素材时选择正确的广告素材。 // adsRequest.linearAdSlotWidth = prerollWidth; // adsRequest.linearAdSlotHeight = 预滚高度; adsRequest.nonLinearAdSlotWidth = 0; adsRequest.nonLinearAdSlotHeight = 0; adsLoader.requestAds(adsRequest); } function createAdDisplayContainer() { // 我们假设 adContainer 是将容纳广告的元素的 DOM id。prerollDocument.getElementById('videoContent').style.display = 'none'; adDisplayContainer = new google.ima .AdDisplayContainer( prerollDocument.getElementById('adContainer'), videoContent); } 函数 unmutePrerollAdvert() { adVolume = !adVolume; 如果 (adVolume) { adsManager.setVolume(0.3); prerollDocument.getElementById('adMuteBtn').innerHTML = ' '; } else { adsManager.setVolume(0); prerollDocument.getElementById('adMuteBtn').innerHTML = ''; } } function onAdsManagerLoaded(adsManagerLoadedEvent) { // 获取广告管理器。 const adsRenderingSettings = new google.ima.AdsRenderingSettings(); adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true; adsRenderingSettings.loadVideoTimeout = 12000; // videoContent 应设置为内容视频元素。 adsManager = adsManagerLoadedEvent.getAdsManager(videoContent, adsRenderingSettings); // 添加监听所需事件。adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, onAdError); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, onContentPauseRequested); adsManager.addEventListener( google.ima.AdEvent.类型.CONTENT_RESUME_REQUESTED, onContentResumeRequested); adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED, onAdEvent); // 如有必要,监听任何其他事件。 adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, onAdEvent); adsManager.addEventListener(google .ima.AdEvent.Type.COMPLETE, onAdEvent); playAds(); } function playAds() { // 初始化容器。必须通过移动设备上的用户操作来完成。videoContent.load(); adDisplayContainer.initialize (); // setupDimensions(); try { // 初始化广告管理器。此时将启动广告规则播放列表。 adsManager.init(1920, 1080, google.ima.ViewMode.NORMAL); // 调用 play 开始展示广告。单个视频和覆盖广告将在此时开始;广告规则将忽略该调用。adsManager.start(); // window.addEventListener('resize', function (event) { // if (adsManager) { // setupDimensions(); // adsManager.resize(prerollWidth, prerollHeight, google.ima.ViewMode.NORMAL); // } // }); } catch (adError) { // 如果 VAST 响应出现问题,则可能会引发错误。 // videoContent.play(); } } function onAdEvent(adEvent) { const ad = adEvent.getAd (); console.log('预贴片事件: ' + adEvent.type); switch (adEvent.type) { case google.ima.AdEvent.Type.LOADED: if (!ad.isLinear()) { videoContent.play( ); } prerollDocument.getElementById('adContainer').style.width = '100%'; prerollDocument.getElementById('adContainer').style.maxWidth = '640px'; prerollDocument.getElementById('adContainer').style.height = '360px'; 打破; 案例 google.ima.AdEvent.Type.STARTED:window.addEventListener('scroll',onActiveView); 如果(ad.isLinear()){ intervalTimer = setInterval( function () { // 示例: const remainingTime = adsManager.getRemainingTime(); // adsManager.pause(); }, 300); // 每 300 毫秒 } prerollDocument.getElementById('adMuteBtn').style.显示 = 'block'; 打破; 案例 google.ima.AdEvent.Type.ALL_ADS_COMPLETED:如果(ad.isLinear()){ clearInterval(intervalTimer); } 如果(prerollLastError === 303){ playYtVideo(); } 打破;案例 google.ima.AdEvent.Type.COMPLETE:如果(ad.isLinear()){ clearInterval(intervalTimer); } playYtVideo(); 打破; } } 函数 onAdError(adErrorEvent){ console.log(adErrorEvent.getError()) ; prerollLastError = adErrorEvent.getError().getErrorCode(); 如果 (!loadNext()) { playYtVideo(); } } 函数 loadNext() { 如果 (prerollCurrent === 0) { iinfoVastUrlIndex++; 如果 (iinfoVastUrlIndex 0.0) { 如果(prerollPaused) { adsManager.resume(); prerollPaused = false; } 返回 true; } else { if (!prerollPaused) { adsManager.pause(); prerollPaused = true; } } } 返回 false; } function playYtVideo() { iinfoPrerollPosition 。消除(); youtubeIframe.style.display = 'block'; youtubeIframe.src += '&autoplay=1&mute=1'; } }
分类:
标签:
留言