From ef6ee239d78c00d6c8c4c4d373a8f0f42875c78f Mon Sep 17 00:00:00 2001 From: alastairR Date: Sat, 17 Oct 2020 15:14:50 +1300 Subject: [PATCH] Add support for NZ Herald videos (#965) --- src/js/contentScript.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/js/contentScript.js b/src/js/contentScript.js index ddf372f..b5260af 100644 --- a/src/js/contentScript.js +++ b/src/js/contentScript.js @@ -496,6 +496,32 @@ function pageContains (selector, text) { } function NZHerald () { + const video = document.querySelector('.video-js'); + if (video) { + const s = document.getElementsByTagName('script')[0]; + if (s.src === '') { + const vId = video.getAttribute('data-account'); + const vPlay = video.getAttribute('data-player'); + const vScript = document.createElement("script"); + vScript.type = 'text/javascript'; + vScript.async = true; + vScript.src = 'https://players.brightcove.net/' + vId + '/' + vPlay + '_default/index.min.js'; + s.parentNode.insertBefore(vScript, s); + const ticker = document.querySelector('.vcTicker'); + if (ticker) { + ticker.style.display = 'none'; + } + const msg = document.querySelector('.vcMsg'); + if (msg) { + msg.style.display = 'none'; + } + const overlay = document.querySelector('.vcOverlay'); + if (overlay) { + overlay.style.display = 'none'; + } + } + } + window.setTimeout(function () { const articleBody = document.querySelector('.article__body'); if (articleBody) {