/** * NBC Player Maker * A Javascript widget that will dynamically create an iframe pointing to * our video player * * Created by: Rob Sable * Date created: 11/19/2013 * * Last edited by: Rob Sable * Last modified: 04/23/2014 */ /** * Usage: * * WARNING: DO NOT CALL .JS FILE DIRECTLY */ if(typeof console == "undefined") { console = {}; console.log = function(msg) { // fail silently } console.warn = function(msg) { // fail silently } console.error = function(msg) { // fail silently } console.info = function(msg) { // fail silently } } (function() { //console.log("/////////////////////////////////////////"); //console.log("/// NBC PLAYER MAKER ////////////////////"); //console.log("/////////////////////////////////////////"); // Gather the scripts on the page. window['nbcLMP7975'] = {}; // Parameter parsing window['nbcLMP7975'].scriptTagsOnPage = document.getElementsByTagName('script'); window['nbcLMP7975'].thisScriptName = '/weather/dmn-forecast'; window['nbcLMP7975'].thisScriptSource = null; window['nbcLMP7975'].activeEmbeds = new Array(); window['nbcLMP7975'].usedEmbeds = new Array(); window['nbcLMP7975'].scriptSplit = null; window['nbcLMP7975'].scriptParams = null; window['nbcLMP7975'].discreteParams = null; window['nbcLMP7975'].useThisAsParent = null; window['nbcLMP7975'].encodedURI = encodeURIComponent(location.origin+location.pathname); window['nbcLMP7975'].encodedHost = encodeURIComponent(location.origin); window['nbcLMP7975'].origin = null; window['nbcLMP7975'].videoThumbPath = '"//media.nbcdfw.com/images/300*169/Dallas_Morning_News_Weather_081817_1200x675_1027816003987.jpg'; // Comb the scripts! for(var a=0; a'); // DOM element creation - THUMBNAIL/PLAY BUTTON window['nbcLMP7975'].thumbnailContainer = document.createElement('div'); // Container with background image as thumbnail window['nbcLMP7975'].playButton = document.createElement('img'); // Absolutely positioned. window['nbcLMP7975'].thumbnailContainer.id = 'nbcrcplayer'; window['nbcLMP7975'].thumbnailContainer.style.width = '300px'; window['nbcLMP7975'].thumbnailContainer.style.height = '169px'; window['nbcLMP7975'].thumbnailContainer.style.position = 'relative'; window['nbcLMP7975'].thumbnailContainer.style.backgroundImage="url('//media.nbcdfw.com/images/300*169/Dallas_Morning_News_Weather_081817_1200x675_1027816003987.jpg')"; window['nbcLMP7975'].playButton.src = 'https://media.nbcdfw.com/designimages/solo_sprite_hp_play_video.png'; window['nbcLMP7975'].playButton.width = 55; window['nbcLMP7975'].playButton.height = 41; window['nbcLMP7975'].playButton.style.position = 'absolute'; window['nbcLMP7975'].playButton.style.top = "68px"; window['nbcLMP7975'].playButton.style.left = "127px"; window['nbcLMP7975'].playButton.onclick=function(){createVideoFrame()}; window['nbcLMP7975'].thumbnailContainer.appendChild(window['nbcLMP7975'].playButton); window['nbcLMP7975'].useThisAsParent.appendChild(window['nbcLMP7975'].thumbnailContainer); window['nbcLMP7975'].noteTheDOMPos = window['nbcLMP7975'].useThisAsParent.lastChild; // DOM element creation - IFRAME function createVideoFrame () { window['nbcLMP7975'].useThisAsParent.removeChild(window['nbcLMP7975'].noteTheDOMPos); window['nbcLMP7975'].videoframe = document.createElement('iframe'); window['nbcLMP7975'].videoframe.style.border = 'none'; window['nbcLMP7975'].videoframe.width = 300; window['nbcLMP7975'].videoframe.height = 169; window['nbcLMP7975'].videoframe.scrolling = "no"; window['nbcLMP7975'].videoframe.src = "https://www.nbcdfw.com/templates/nbc_partner_player?cmsID=441035683&videoID=QqpMQy6o2Brt&autoplay=true&origin=www.nbcdfw.com&sec=news&subsec=weather&width=300&height=169&rand=7975&turl="+window['nbcLMP7975'].encodedURI + "&ourl=" + window['nbcLMP7975'].encodedHost + "&lp=1"; window['nbcLMP7975'].useThisAsParent.appendChild(window['nbcLMP7975'].videoframe); } })();