Vysoké IQ = málo pirátství, Acer napadený hackery a Spotify vs. Apple

3. 7. 2016
Doba čtení: 11 minut

Sdílet

Autor: Isifa
Rip Authorship markup, F pattern už nefrčí, výlet do historie s Iridium, paranoidní Mark, konec MacNN. Co přinesl právě končící #tyden.

Autoři britské „Leave“ kampaně smazali obsah webu – mažou tak stopy kvůli obviněním, že si vymýšleli. Viz Brexit ‚Leave‘ campaign wipes website amid accusations of false promises, a pokud byste se chtěli podívat, co tam bylo, tak Internet Archive toho má schovaného poměrně dost. Najdete tam řadu tvrzení, která se už v průběhu kampaně ukázala jako absurdní výmysly.

Britové po hlasování o brexitu nehledali nijak moc extra „What is the EU“, to jen média netuší, jak fungují Google Trends. A teď je okolo toho ještě veseleji. V No, Britons Were Not Frantically Googling ‘What Is The EU?’ Hours After Brexit Vote se to snaží rozebírat na základě článku od Remy Smith, který správně upozorňuje, že pokud chcete analyzovat Google Trends, tak je potřeba si vzít na pomoc AdWords Keyword Planner. A jestli ještě nemáte dost věcí ke čtení, zkuste Stop Using Google Trends.

Výborný kousek od CollegeHumor na téma algoritmus Facebooku. Viz Facebook’s Algorithm is Like the Mafia:

TELEgraficky

Huawei pracuje na vlastním OS ■ Znáte Librivox? ■ Zelená věc na bankomatu je extrémní riziko ■ RIP Surface 3E-Mail from Bill ■ Ve čtvrtek poněkud padl Google Calendar ■ Povedený krátký film ME2 ■ Apple chce koupit Tidal ■ Fotky zdarma na Stockified ■ I Love Movies, IMAX Movies

WEBDESIGN, INTERNET

Authorship markup můžete odstranit, Google už ho nevyužívá. Tedy, on ho Google přestal (skoro) používat už před několika lety, ale teprve teď je potvrzené, že je (zcela) pryč. Viz Google: It Is Now Safe To Remove Authorship Markup, We Don't Use It Anymore, a pokud je vám líto zbytečně vynaloženého úsilí na něco takového, tak se s tím prostě musíte smířit. Takhle to je a bude. Což taky znamená, že ho možná zase vrátí. A pak zase odstraní. Prostě život.

Hamburger Menus and Hidden Navigation Hurt UX Metrics obsahuje dost věcí, které se řadě lidí daří jen těžko vysvětlovat. Třeba to, že skrývaní navigací je problém, protože lidé prostě nenajdou, co najít mají. A mimo jiné souhlasím s tím, že skrývat navigaci na desktopu je nesmysl.

Facebook mění vzhled Like/Líbí prvku. Má zaoblenější rohy, mizí „f“ coby logo a počet se dostává dovnitř, už není ve vnější bublině. Viz Modernizing Social Plugin buttons a dobrá zpráva je, že nová verze by měla být stejně velká, takže bez nutnosti napravovat váš design.

Jak se lidé dívají na výsledky vyhledávání v Googlu a Bingu? Důležité je, a to už ukázaly i jiné studie, že přestává platit doposud uznávaný „F“ vzorec. Viz How do people view search engine results pages?

SOFTWARE

V „zemích s vysokým IQ“ je nízká míra pirátství. Zajímavé zjištění. Viz HIGH IQ COUNTRIES HAVE LESS SOFTWARE PIRACY, RESEARCH FINDS.

Mozilla testuje kontejnery – oddělené identity mající vlastní cookies, historii a vůbec všechno. Což není nic tak zázračného, Chrome to má v podobě profilů už dlouho a jsou snadno použitelné. Nakonec i ve Firefoxu toho lze dosáhnout (viz Jak ve Firefoxu vytvořit a spouštět více profilů?). Bohužel dosáhnout toho bylo dosud zbytečně složité a právě nové kontejnery to zásadně zjednodušují, viz Mozilla Tests Firefox Containers For Separate Online Identities.

HARDWARE 

Google bude mít prý vlastní chytrý telefon. Opravdu vlastní, nikoliv jak tomu bylo doposud s Nexus modely, které vyráběl někdo jiný. Viz Google to step up smartphone wars with release of own handset, kde ale poněkud míchají páté přes deváté a nevypadá to, že by příliš pochopili, jak to je s Androidem.

Máme tady první smrt řidiče v Tesle s automatickým řízením. V USA se to teď chystají vyšetřovat regulační orgány. Auto narazilo do přívěsu otáčejícího se nákladního automobilu. Ve vyjádření Tesly je uvedeno, že ani řidič ani auto, nerozpoznalo bílý bok návěsu proti světlé obloze. Viz Self-Driving Tesla Was Involved in Fatal Crash, U.S. Says a U.S. opens investigation in Tesla after fatal crash in Autopilot mode. K případu se navíc objevila informace, že se prý řidič při jízdě díval na Harryho Pottera (viz Tesla Autopilot victim may have been watching ‚Harry Potter‘ during crash). Na což Tesla reagovala upozorněním, že jejich palubní systém něco takového vůbec neumí :)

RIP Eye-Fi. Tedy lépe řečeno, starší modely Eye-Fi karet končí 16. září. Týká se to modelů X1 a X2, které už nejsou v prodeji poměrně dlouho. Nová řada v prodeji je Mobi (od dubna 2015), kterou si můžete pořídit místo starých modelů (a Eye-Fi nabízí 20% slevu). Tedy, pokud nebude lepší si koupit foťák, který umí WiFi. Viz EF 1.0 (X1, X2) End of Life Information.

Pamatujete ještě na Iridium? Jeden z nejambicióznějších produktů je dnes už jenom ozvěnou časů minulých (ale po bankrotu se ho podařilo zachránit a stále funguje). Viz Highs and lows (pozor, The Exonomist je placený) či The Fall and Rise of Iridium. A pro připomenutí, odstartoval v roce 1998, kdy něco jako globální mobilní síť a všudypřítomné smartphony byly sci-fi. Jenže to, co z Iridia dělalo zázračnou, unikátní a technologicky vyspělou věc, nakonec nestačilo. Síť satelitů zabil příchod chytrých telefonů, ale také vlastní nastavené podmínky a mantinely. Čtěte případně ještě v ‚Eccentric Orbits‘ chronicles the stunning failure (and improbable revival) of the Iridium satellite phone.

Je tady nový, tenčí a lehčí Kindle. A navíc také bílý. Viz Amazon’s redesigned Kindle is thinner, lighter, and comes in white.

MARKETING A KOMUNIKACE

Studie tweetů spojených s TV pořady zjistila, že k sledování více přispívají ty, které jsou nenávistné. Viz A Study of TV-Related Tweets Finds Hate More Than Love Drives Viewership, kde zjistíte, že negativní emoce jsou třikrát silnější než ty pozitivní.

Seznamovací aplikace na jedné straně podporují sebevědomí, na druhé vyvolávají deprese. Není divu, pokud se jako příklad vezme Tinder, tak je to tak z 50 % kupa účtu s odstrašujícími fotkami nebo bez fotek, z 40 % s fotkami slušnými a 10 % buď fotí modeling, nebo to jsou falešné účty s nakradenými fotkami. Alespoň takový je pocit, když Tinder chvíli používáte. A pak je tu studie, která zjistila, že 80 % žen si upravilo fotky, 45 % začalo uvažovat o plastice.

BEZPEČNOST, SOUKROMÍ, PRÁVO

Snapchat prý pro jeden ze svých filtrů zkopíroval práci známých expertů na makeup. Viz SNAPCHAT UNDER FIRE FOR ALLEGEDLY COPYING WORK OF POPULAR MAKEUP ARTISTS a nutno dodat, že by to vlastně ani nepřekvapilo. Je těžké najít jinou službu s tak bohatou historií bezpečnostních malérů a zábavných manipulací s uživateli. A jak už to tak chodí, poté, co se autorka ohradila a dostala od Snapchatu typickou odpověď: „nic takového neděláme“, se předmětný filtr ztratil. A totéž se stalo v dalším případě. Po dalším čekání ale Snapchat „uznal“, že se „nechali příliš inspirovat“. Ano, to říkají zloději v těchto případech prakticky vždy. Viz též Snapchat Accused of Stealing Make-Up Artists’ Work for Selfie Filters.

PayPal napravil bezpečnostní chybu umožňující útočníkům zneužívat obrázky. Viz PayPal has fixed a vulnerability that could have been exploited by attackers to deliver malicious images through the payment pages of the website.

Acer potvrdil napadení hackery. Špatné je, že ti se podívali do útrob e-shopu Aceru. Dobrá zpráva je, že nás v Česku se to asi příliš netýká, ale možná tam někdo nakupoval přímo. V takovém případě je jeho platební karta zralá na výměnu. Viz The Taiwanese electronics company Acer informed its customers that some of their sensitive financial data may have been accessed by hackers.

Mark Zuckerberg si na notebooku přelepuje kameru a zaslepuje konektor pro mikrofon. Ano, je to stejný člověk, který si nechal hacknout účty na sociálních sítích. Měl na nich stejné heslo jako to, které použil na LinkedIn a nezměnil ho ani poté, co se hesla z LinkedIn proflákla (dokonce dvakrát). O tom, že by měl používat dvoufaktor, raději nemluvit, takže v tomhle určitě nebuďte jako Mark.  Viz Mark Zuckerberg tapes up his webcam, kde sice zaslepení kamery pochopíte (ano, opravdu dává smysl), ale tu přelepku přes konektor jenom těžko (z hlediska bezpečnosti).

Facebook vyhrál spor s belgickým úřadem na ochranu soukromí. Může pokračovat ve sledování Belgičanů, kteří nemají na Facebooku účet. Což je téma s velkými otazníky. Hlavně proto, že Facebook sleduje uživatele i po odhlášení a také si vytváří profily lidí, kteří vůbec nejsou jeho uživateli. Facebook ale vyhrál jen kvůli tomu, že podle soudu je tento spor právně potřeba řešit v Irsku – Belgie je místně nepříslušná. Viz Facebook wins privacy case against Belgium’s data protection authority.

WPS ve WiFi routeru je dobré vypnout. Ve We TOLD you not to use WPS on your Wi-Fi router! We TOLD you not to knit your own crypto! je to dost dobře vysvětlené a jakkoliv jde o tip z dubna 2015, je čas ho připomenout.

SOCIÁLNÍ SÍTĚ

Twitter přidává grafické nálepky, #Stickers. To, aby vypadal trochu víc jako Snapchat. Zábavné na tom je, že pro stávající uživatele je to další funkce, po které vůbec netouží. A pro ty, kteří po něčem takovém touží, je Twitter stále stejně nepoužitelný. Nálepky do fotek najdete pouze na iOSu a Androidu a budete muset počkat, než se k vám dostanou. Viz Twitter introduces #Stickers, giving your timeline a taste of Snapchat.

Snapchat hlásí 150 milionů denních aktivní účtů (DAU). Což je více než má Twitter. V prosinci měl Snapchat 110 milionů, byť stále je potřeba tahle čísla brát s rezervou. Sami si je měří, sami si je reportují, nikdo to neověřuje a nikdo neví, jakou metriku reálně používají. Přehled sociálních sítí, médií a služeb včetně počtu uživatelů celosvětově i v Česku tedy opět aktualizován. A zdroj 150 M viz Snapchat Passes Twitter in Daily Usage.

Facebook Slideshow vám umožní udělat z fotek prezentaci. Prozatím tedy pouze na iOSu a podle všeho se tak Facebook nejspíš snaží reagovat na Snapchat stories a podobné nástroje od Googlu (Movie Assistant), Apple (Memories). Nezbývá než Facebooku pogratulovat k pokračujícímu vývoji ve stále monstróznějšímu slepci.

Na Messengeru ve Facebooku je přes 11 000 botů. Pokud ale žádný nepoužíváte, nic divného na tom není. Jsou v podstatě neobjevitelné a většina z nich je absolutně nepoužitelná. Nezbývá doufat, že tahle mánie časem pomine a zůstane přijatelný počet botů, které jsou opravdu použitelné. Viz More Than 11,000 Bots Are Now On Facebook Messenger.

MOBILNÍ APLIKACE

Vypadá to tak trochu na konec Evernotu – zdražuje a přicházejí omezení. Zdarma zůstane, pokud si vystačíte se synchronizací na maximálně dvě zařízení. A placené služby výrazně zdražily. Viz Evernote zdražuje své placené služby a omezuje ty zdarma nebo Changes to Evernote’s Pricing Plans a nějak tak k tomu dodám, že to už je opravdu lepší si platit Google Apps. O Gmailu s Google Docs zadarmo bez omezení raději ani snad nemluvit. Škoda.

RIP Paper. Aplikace od Facebooku na čtení novin skončí k 29. červenci. Připomeňme, že když ji Facebook uvedl na trh, rozhodl se zlikvidovat a převálcovat již existující aplikaci Paper. Aplikace se sice líbila odborníkům, ale uživatelé ji nechtěli používat. Ale to bylo v lednu 2014 a Facebook byl posedlý zbytečnými animacemi. Každopádně Paper se nikdy nerozšířil dál než na iOS a dostupnost byla navíc významně omezena jenom na některé země. Viz Facebook is shutting down its Paper newsreading app on July 29th.

Nové Spotify bylo Applem odmítnuto v App Store prý proto, že aplikace porušovala „Pravidla“ (ta od Applu). Spotify zase tvrdí, že Apple nesnese konkurenci pro Apple Music. A tak se obě firmy usilovně hádají přes media. Viz Apple Slams Spotify, Says App Already Violates App Store Rules a Spotify says Apple won’t approve a new version of its app because it doesn’t want competition for Apple Music.

STARTUPY A EKONOMIKA

MacNN končí 1. července po více než dvaceti letech existence. MacNN (Macintosh New Network) vydržel velmi dlouho, ale konec IT/C magazínu je poměrně nevyhnutelný, čím se předmět jejich psaní stane rozšířením, tím méně je potřeba mít specializovaný titul. Viz Apple news site MacNN is shutting down on July 1.

Intel zvažuje prodej McAfee. Což, pokud nevíte, je antivirová společnost, kterou kdysi vlastnil legendární John McAfee. Před šesti lety Intel stála 7 miliard dolarů. Tohle bude zajímavé sledovat. Viz Tech Five: Intel may sell McAfee business.

53 akvizicí Marissy Mayer pro Yahoo a jak dopadly. Šikovný přehled v Here's What Happened To All 53 of Marissa Mayer's Yahoo Acquisitions, kde už snad ani nepřekvapí, že 41 koupených společností bylo zlikvidováno, pár jich pokračovalo poněkud nepřímo někde v Yahoo a jenom pár jich existuje stále (ano, jedna z nich je Tumblr).

Move Loot končí, náklady zahubily další startup. V The startup that wanted to dethrone Craigslist is officially shutting down je užitečné čtení o tom, co se jim nedařilo, a vypadá to prostě na sérii klasického hledání obchodního a provozního modelu, který nikdy nefungoval, spojeného s nadměrnými náklady. Ale i takový ten díl „porazíme IKEA“ a „vytvoříme lepší Craigslist“ tam najdete. Konec je navíc neveselý, zákazníci si stěžují na to, že přišli o peníze, a Move Loot čelí i obvinění, že prodává databázi zákazníků. „Move Fast And Break Things“ v praxi.

E-KNIHY

Startuje Svobodná e-knihovna Liberary.cz a je to malinké. Což je dobrá příležitost pro každého, kdo může pomoci.

INFOGRAFIKY

The history of urbanization, 3700 BC – 2000 AD je povedená vizualizace.

What Motivates People to Share on Facebook? (Infographics) se věnuje tomu, co vede lidi ke sdílení na Facebooku.

SEO Mega-Checklist: 75 steps to increased visibility for your site (infographic) aneb Zapněte už někdo to SEO!

MM Influenceři

Co se (většinou) nedostalo do článků a stojí z právě uplynulého týdne za pozornost. Mohlo by se hodit, mohlo by zaujmout, možná to prostě jenom nějak tak uniklo v záplavě stovek článků a zpráv, které se v uplynulém týdnu objevily. Ručně tříděné ze stovek zdrojů a tisíců přečtených zpráv. V drtivé většině zahraničních. 

Vzniká průběžně celý týden.

Autor článku

Konzultant a publicista, provozuje www.pooh.cz. Podle některých si myslí, že rozumí všemu, sám je však přesvědčen o pravém opaku a ani v 30+ letech nedokázal přijít na to, jak mít peníze a nepracovat.
'; document.getElementById('preroll-iframe').onload = function () { setupIframe(); } prerollContainer = document.getElementsByClassName('preroll-container-iframe')[0]; } function setupIframe() { prerollDocument = document.getElementById('preroll-iframe').contentWindow.document; let el = prerollDocument.createElement('style'); prerollDocument.head.appendChild(el); el.innerText = "#adContainer>div:nth-of-type(1),#adContainer>div:nth-of-type(1) > iframe { width: 99% !important;height: 99% !important;max-width: 100%;}#videoContent,body{ width:100vw;height:100vh}body{ font-family:'Helvetica Neue',Arial,sans-serif}#videoContent{ overflow:hidden;background:#000}#adMuteBtn{ width:35px;height:35px;border:0;background:0 0;display:none;position:absolute;fill:rgba(230,230,230,1);bottom:20px;right:25px}"; videoContent = prerollDocument.getElementById('contentElement'); videoContent.style.display = 'none'; videoContent.volume = 1; videoContent.muted = false; const playPromise = videoContent.play(); if (playPromise !== undefined) { playPromise.then(function () { console.log('PREROLL sound allowed'); // setUpIMA(true); videoContent.volume = 1; videoContent.muted = false; setUpIMA(); }).catch(function () { console.log('PREROLL sound forbidden'); videoContent.volume = 0; videoContent.muted = true; setUpIMA(); }); } } function setupDimensions() { prerollWidth = Math.min(iinfoPrerollPosition.offsetWidth, 480); prerollHeight = Math.min(iinfoPrerollPosition.offsetHeight, 320); } function setUpIMA() { google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true); google.ima.settings.setLocale('cs'); google.ima.settings.setNumRedirects(10); // Create the ad display container. createAdDisplayContainer(); // Create ads loader. adsLoader = new google.ima.AdsLoader(adDisplayContainer); // Listen and respond to ads loaded and error events. adsLoader.addEventListener( google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, onAdsManagerLoaded, false); adsLoader.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, onAdError, false); // An event listener to tell the SDK that our content video // is completed so the SDK can play any post-roll ads. const contentEndedListener = function () { adsLoader.contentComplete(); }; videoContent.onended = contentEndedListener; // Request video ads. const adsRequest = new google.ima.AdsRequest(); adsRequest.adTagUrl = iinfoVastUrls[iinfoVastUrlIndex]; console.log('Preroll advert: ' + iinfoVastUrls[iinfoVastUrlIndex]); videoContent.muted = false; videoContent.volume = 1; // Specify the linear and nonlinear slot sizes. This helps the SDK to // select the correct creative if multiple are returned. // adsRequest.linearAdSlotWidth = prerollWidth; // adsRequest.linearAdSlotHeight = prerollHeight; adsRequest.nonLinearAdSlotWidth = 0; adsRequest.nonLinearAdSlotHeight = 0; adsLoader.requestAds(adsRequest); } function createAdDisplayContainer() { // We assume the adContainer is the DOM id of the element that will house // the ads. prerollDocument.getElementById('videoContent').style.display = 'none'; adDisplayContainer = new google.ima.AdDisplayContainer( prerollDocument.getElementById('adContainer'), videoContent); } function unmutePrerollAdvert() { adVolume = !adVolume; if (adVolume) { adsManager.setVolume(0.3); prerollDocument.getElementById('adMuteBtn').innerHTML = ''; } else { adsManager.setVolume(0); prerollDocument.getElementById('adMuteBtn').innerHTML = ''; } } function onAdsManagerLoaded(adsManagerLoadedEvent) { // Get the ads manager. const adsRenderingSettings = new google.ima.AdsRenderingSettings(); adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true; adsRenderingSettings.loadVideoTimeout = 12000; // videoContent should be set to the content video element. adsManager = adsManagerLoadedEvent.getAdsManager(videoContent, adsRenderingSettings); // Add listeners to the required events. adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, onAdError); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, onContentPauseRequested); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, onContentResumeRequested); adsManager.addEventListener( google.ima.AdEvent.Type.ALL_ADS_COMPLETED, onAdEvent); // Listen to any additional events, if necessary. adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE, onAdEvent); playAds(); } function playAds() { // Initialize the container. Must be done through a user action on mobile // devices. videoContent.load(); adDisplayContainer.initialize(); // setupDimensions(); try { // Initialize the ads manager. Ad rules playlist will start at this time. adsManager.init(1920, 1080, google.ima.ViewMode.NORMAL); // Call play to start showing the ad. Single video and overlay ads will // start at this time; the call will be ignored for ad rules. adsManager.start(); // window.addEventListener('resize', function (event) { // if (adsManager) { // setupDimensions(); // adsManager.resize(prerollWidth, prerollHeight, google.ima.ViewMode.NORMAL); // } // }); } catch (adError) { // An error may be thrown if there was a problem with the VAST response. // videoContent.play(); } } function onAdEvent(adEvent) { const ad = adEvent.getAd(); console.log('Preroll event: ' + 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'; break; case google.ima.AdEvent.Type.STARTED: window.addEventListener('scroll', onActiveView); if (ad.isLinear()) { intervalTimer = setInterval( function () { // Example: const remainingTime = adsManager.getRemainingTime(); // adsManager.pause(); }, 300); // every 300ms } prerollDocument.getElementById('adMuteBtn').style.display = 'block'; break; case google.ima.AdEvent.Type.ALL_ADS_COMPLETED: if (ad.isLinear()) { clearInterval(intervalTimer); } if (prerollLastError === 303) { playYtVideo(); } break; case google.ima.AdEvent.Type.COMPLETE: if (ad.isLinear()) { clearInterval(intervalTimer); } playYtVideo(); break; } } function onAdError(adErrorEvent) { console.log(adErrorEvent.getError()); prerollLastError = adErrorEvent.getError().getErrorCode(); if (!loadNext()) { playYtVideo(); } } function loadNext() { iinfoVastUrlIndex++; if (iinfoVastUrlIndex < iinfoVastUrls.length) { iinfoPrerollPosition.remove(); playPrerollAd(); } else { return false; } adVolume = 1; return true; } function onContentPauseRequested() { videoContent.pause(); } function onContentResumeRequested() { videoContent.play(); } function onActiveView() { if (prerollContainer) { const containerOffset = prerollContainer.getBoundingClientRect(); const windowHeight = window.innerHeight; if (containerOffset.top < windowHeight/1 && containerOffset.bottom > 0.0) { if (prerollPaused) { adsManager.resume(); prerollPaused = false; } return true; } else { if (!prerollPaused) { adsManager.pause(); prerollPaused = true; } } } return false; } function playYtVideo() { iinfoPrerollPosition.remove(); youtubeIframe.style.display = 'block'; youtubeIframe.src += '&autoplay=1&mute=1'; } }
Upozorníme vás na články, které by vám neměly uniknout (maximálně 2x týdně).
'; document.getElementById('outstream-iframe').onload = function () { setupIframe(); } replayScreen = document.getElementById('iinfoOutstreamReplay'); iinfoOutstreamPosition = document.getElementById('iinfoOutstreamPosition'); outstreamContainer = document.getElementsByClassName('outstream-container')[0]; setupReplayScreen(); } function setupIframe() { outstreamDocument = document.getElementById('outstream-iframe').contentWindow.document; let el = outstreamDocument.createElement('style'); outstreamDocument.head.appendChild(el); el.innerText = "#adContainer>div:nth-of-type(1),#adContainer>div:nth-of-type(1) > iframe { width: 99% !important;height: 99% !important;max-width: 100%;}#videoContent,body{ width:100vw;height:100vh}body{ font-family:'Helvetica Neue',Arial,sans-serif}#videoContent{ overflow:hidden;background:#000}#adMuteBtn{ width:35px;height:35px;border:0;background:0 0;display:none;position:absolute;fill:rgba(230,230,230,1);bottom:-5px;right:25px}"; videoContent = outstreamDocument.getElementById('contentElement'); videoContent.style.display = 'none'; videoContent.volume = 1; videoContent.muted = false; if ( location.href.indexOf('rejstriky.finance.cz') !== -1 || location.href.indexOf('finance-rejstrik') !== -1 || location.href.indexOf('firmy.euro.cz') !== -1 || location.href.indexOf('euro-rejstrik') !== -1 || location.href.indexOf('/rejstrik/') !== -1 || location.href.indexOf('/rejstrik-firem/') !== -1) { outstreamDirectPlayed = true; soundAllowed = true; iinfoVastUrlIndex = 0; } if (!outstreamDirectPlayed) { console.log('OUTSTREAM direct'); setUpIMA(true); } else { if (soundAllowed) { const playPromise = videoContent.play(); if (playPromise !== undefined) { playPromise.then(function () { console.log('OUTSTREAM sound allowed'); setUpIMA(false); }).catch(function () { console.log('OUTSTREAM sound forbidden'); renderBanner(); }); } } else { renderBanner(); } } } function getWrapper() { let articleWrapper = document.querySelector('.rs-outstream-placeholder'); // Outstream Placeholder from RedSys manipulation if (articleWrapper && articleWrapper.style.display !== 'block') { articleWrapper.innerHTML = ""; articleWrapper.style.display = 'block'; } // Don't render OutStream on homepages if (articleWrapper === null) { if (document.querySelector('body.p-index')) { return null; } } if (articleWrapper === null) { articleWrapper = document.getElementById('iinfo-outstream'); } if (articleWrapper === null) { articleWrapper = document.querySelector('.layout-main__content .detail__article p:nth-of-type(6)'); } if (articleWrapper === null) { // Euro, Autobible, Zdravi articleWrapper = document.querySelector('.o-article .o-article__text p:nth-of-type(6)'); } if (articleWrapper === null) { articleWrapper = document.getElementById('sidebar'); } if (!articleWrapper) { console.error("Outstream wrapper of article was not found."); } return articleWrapper; } function setupDimensions() { outstreamWidth = Math.min(iinfoOutstreamPosition.offsetWidth, 480); outstreamHeight = Math.min(iinfoOutstreamPosition.offsetHeight, 320); } /** * Sets up IMA ad display container, ads loader, and makes an ad request. */ function setUpIMA(direct) { google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true); google.ima.settings.setLocale('cs'); google.ima.settings.setNumRedirects(10); // Create the ad display container. createAdDisplayContainer(); // Create ads loader. adsLoader = new google.ima.AdsLoader(adDisplayContainer); // Listen and respond to ads loaded and error events. adsLoader.addEventListener( google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, onAdsManagerLoaded, false); adsLoader.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, onAdError, false); // An event listener to tell the SDK that our content video // is completed so the SDK can play any post-roll ads. const contentEndedListener = function () { adsLoader.contentComplete(); }; videoContent.onended = contentEndedListener; // Request video ads. const adsRequest = new google.ima.AdsRequest(); if (direct) { adsRequest.adTagUrl = directVast; console.log('Outstream DIRECT CAMPAING advert: ' + directVast); videoContent.muted = true; videoContent.volume = 0; outstreamDirectPlayed = true; } else { adsRequest.adTagUrl = iinfoVastUrls[iinfoVastUrlIndex]; console.log('Outstream advert: ' + iinfoVastUrls[iinfoVastUrlIndex]); videoContent.muted = false; videoContent.volume = 1; } // Specify the linear and nonlinear slot sizes. This helps the SDK to // select the correct creative if multiple are returned. // adsRequest.linearAdSlotWidth = outstreamWidth; // adsRequest.linearAdSlotHeight = outstreamHeight; adsRequest.nonLinearAdSlotWidth = 0; adsRequest.nonLinearAdSlotHeight = 0; adsLoader.requestAds(adsRequest); } function setupReplayScreen() { replayScreen.addEventListener('click', function () { iinfoOutstreamPosition.remove(); iinfoVastUrlIndex = 0; outstreamInit(); }); } /** * Sets the 'adContainer' div as the IMA ad display container. */ function createAdDisplayContainer() { // We assume the adContainer is the DOM id of the element that will house // the ads. outstreamDocument.getElementById('videoContent').style.display = 'none'; adDisplayContainer = new google.ima.AdDisplayContainer( outstreamDocument.getElementById('adContainer'), videoContent); } function unmuteAdvert() { adVolume = !adVolume; if (adVolume) { adsManager.setVolume(0.3); outstreamDocument.getElementById('adMuteBtn').innerHTML = ''; } else { adsManager.setVolume(0); outstreamDocument.getElementById('adMuteBtn').innerHTML = ''; } } /** * Loads the video content and initializes IMA ad playback. */ function playAds() { // Initialize the container. Must be done through a user action on mobile // devices. videoContent.load(); adDisplayContainer.initialize(); // setupDimensions(); try { // Initialize the ads manager. Ad rules playlist will start at this time. adsManager.init(1920, 1080, google.ima.ViewMode.NORMAL); // Call play to start showing the ad. Single video and overlay ads will // start at this time; the call will be ignored for ad rules. adsManager.start(); // window.addEventListener('resize', function (event) { // if (adsManager) { // setupDimensions(); // adsManager.resize(outstreamWidth, outstreamHeight, google.ima.ViewMode.NORMAL); // } // }); } catch (adError) { // An error may be thrown if there was a problem with the VAST response. // videoContent.play(); } } /** * Handles the ad manager loading and sets ad event listeners. * @param { !google.ima.AdsManagerLoadedEvent } adsManagerLoadedEvent */ function onAdsManagerLoaded(adsManagerLoadedEvent) { // Get the ads manager. const adsRenderingSettings = new google.ima.AdsRenderingSettings(); adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true; adsRenderingSettings.loadVideoTimeout = 12000; // videoContent should be set to the content video element. adsManager = adsManagerLoadedEvent.getAdsManager(videoContent, adsRenderingSettings); // Add listeners to the required events. adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, onAdError); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, onContentPauseRequested); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, onContentResumeRequested); adsManager.addEventListener( google.ima.AdEvent.Type.ALL_ADS_COMPLETED, onAdEvent); // Listen to any additional events, if necessary. adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, onAdEvent); adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE, onAdEvent); playAds(); } /** * Handles actions taken in response to ad events. * @param { !google.ima.AdEvent } adEvent */ function onAdEvent(adEvent) { // Retrieve the ad from the event. Some events (for example, // ALL_ADS_COMPLETED) don't have ad object associated. const ad = adEvent.getAd(); console.log('Outstream event: ' + adEvent.type); switch (adEvent.type) { case google.ima.AdEvent.Type.LOADED: // This is the first event sent for an ad - it is possible to // determine whether the ad is a video ad or an overlay. if (!ad.isLinear()) { // Position AdDisplayContainer correctly for overlay. // Use ad.width and ad.height. videoContent.play(); } outstreamDocument.getElementById('adContainer').style.width = '100%'; outstreamDocument.getElementById('adContainer').style.maxWidth = '640px'; outstreamDocument.getElementById('adContainer').style.height = '360px'; break; case google.ima.AdEvent.Type.STARTED: window.addEventListener('scroll', onActiveView); // This event indicates the ad has started - the video player // can adjust the UI, for example display a pause button and // remaining time. if (ad.isLinear()) { // For a linear ad, a timer can be started to poll for // the remaining time. intervalTimer = setInterval( function () { // Example: const remainingTime = adsManager.getRemainingTime(); // adsManager.pause(); }, 300); // every 300ms } outstreamDocument.getElementById('adMuteBtn').style.display = 'block'; break; case google.ima.AdEvent.Type.ALL_ADS_COMPLETED: if (ad.isLinear()) { clearInterval(intervalTimer); } if (outstreamLastError === 303) { if (isBanner) { renderBanner(); } else { replayScreen.style.display = 'flex'; } } break; case google.ima.AdEvent.Type.COMPLETE: // This event indicates the ad has finished - the video player // can perform appropriate UI actions, such as removing the timer for // remaining time detection. if (ad.isLinear()) { clearInterval(intervalTimer); } if (isBanner) { renderBanner(); } else { replayScreen.style.display = 'flex'; } break; } } /** * Handles ad errors. * @param { !google.ima.AdErrorEvent } adErrorEvent */ function onAdError(adErrorEvent) { // Handle the error logging. console.log(adErrorEvent.getError()); outstreamLastError = adErrorEvent.getError().getErrorCode(); if (!loadNext()) { renderBanner(); } } function renderBanner() { if (isBanner) { console.log('Outstream: Render Banner'); iinfoOutstreamPosition.innerHTML = ""; iinfoOutstreamPosition.style.height = "330px"; iinfoOutstreamPosition.appendChild(bannerDiv); } else { console.log('Outstream: Banner is not set'); } } function loadNext() { iinfoVastUrlIndex++; if (iinfoVastUrlIndex < iinfoVastUrls.length) { iinfoOutstreamPosition.remove(); outstreamInit(); } else { return false; } adVolume = 1; return true; } /** * Pauses video content and sets up ad UI. */ function onContentPauseRequested() { videoContent.pause(); // This function is where you should setup UI for showing ads (for example, // display ad timer countdown, disable seeking and more.) // setupUIForAds(); } /** * Resumes video content and removes ad UI. */ function onContentResumeRequested() { videoContent.play(); // This function is where you should ensure that your UI is ready // to play content. It is the responsibility of the Publisher to // implement this function when necessary. // setupUIForContent(); } function onActiveView() { if (outstreamContainer) { const containerOffset = outstreamContainer.getBoundingClientRect(); const windowHeight = window.innerHeight; if (containerOffset.top < windowHeight/1 && containerOffset.bottom > 0.0) { if (outstreamPaused) { adsManager.resume(); outstreamPaused = false; } return true; } else { if (!outstreamPaused) { adsManager.pause(); outstreamPaused = true; } } } return false; } let outstreamInitInterval; if (typeof cpexPackage !== "undefined") { outstreamInitInterval = setInterval(tryToInitializeOutstream, 100); } else { const wrapper = getWrapper(); if (wrapper) { let outstreamInitialized = false; window.addEventListener('scroll', () => { if (!outstreamInitialized) { const containerOffset = wrapper.getBoundingClientRect(); const windowHeight = window.innerHeight; if (containerOffset.top < windowHeight / 1 && containerOffset.bottom > 0.0) { outstreamInit(); outstreamInitialized = true; } } }); } } function tryToInitializeOutstream() { const wrapper = getWrapper(); if (wrapper) { const containerOffset = wrapper.getBoundingClientRect(); const windowHeight = window.innerHeight; if (containerOffset.top < windowHeight / 1 && containerOffset.bottom > 0.0) { if (cpexPackage.adserver.displayed) { clearInterval(outstreamInitInterval); outstreamInit(); } } } else { clearInterval(outstreamInitInterval); } } }
OSZAR »