// Wrap in anonymous function so the embed code doesn't pollute global scope (function() { var theo_player; function player_load() { var config = { libraryLocation: "https://cdn.myth.theoplayer.com/823e42ef-302f-407e-8e77-e80644fb604a", license: "sZP7IYe6T6P6IuBk3Q0zCZk10LxeFSxeTSB-TSP60OkeIlCL3LCi3uhi0Da6FOPlUY3zWokgbgjNIOf9fl4e3SRo3Lb_FS0rIDf-3ufi3Oz_3o36FSRiCSBt3Lh_0lxKTmfVfK4_bQgZCYxNWoryIQXzImf90Sbi0S0LTuai0u5i0Oi6Io4pIYP1UQgqWgjeCYxgflEc3lar3LeZ3Sec0LBcFOPeWok1dDrLYtA1Ioh6TgV6v6fVfKcqCoXVdQjLUOfVfGxEIDjiWQXrIYfpCoj-fgzVfKxqWDXNWG3ybojkbK3gflNWfKcqCoXVdQjLUOfVfGxEIDjiWQXrIYfpCoj-f6i6UojtsKBpCoj-fgzVfG3edt06TgV6dwx-Wuh6Ymi6bo4pIXjNWYAZIY3LdDjpflNzbG4gya", ui: { fluid: "true", width: "640" }, mutedAutoplay: 'all' }; var cont = document.getElementById('wowza_player'); var playerCont = document.createElement('div'); playerCont.classList.add('theoplayer-container', 'video-js', 'theoplayer-skin') var el = cont.appendChild(playerCont) if (config.ui.fluid == "true") config.ui.fluid = true else { config.ui.fluid = false // Maintian 16:9 aspect ratio config.ui.height = config.ui.width * .5625; config.ui.width = config.ui.width * 1; } theo_player = new THEOplayer.Player(el, config); var closed_captions_type = "none".toLowerCase(); if (closed_captions_type == "none") disableClosedCaptions(theo_player); var wowzaSession = theoplayerWowza.registerPlayer(theo_player); theo_player.source = { poster: "", sources: [ { src: "//cdn3.wowza.com/1/RDNrWTR0UnFJVUhz/K0NtdTFv/hls/live/playlist.m3u8" } ], metadata: { wowza: { jsonUrl: "//player.video.wowza.com/hosted/p7twhjcj/wowza.json", statechangeCallback: console.log, datachangeCallback: console.log } } } } function disableClosedCaptions(theo_player){ theo_player.textTracks.forEach(function(track) { track.mode = "disabled"; }); const controlBar = theo_player.ui.controlBar; controlBar.removeChild(controlBar.subtitlesButton); const sub = document.querySelector('.theoplayer-skin li[aria-label="Open the subtitle options menu"]'); sub.parentNode.removeChild(sub); } function loadWowzaTheoLibrary() { var wrapper = document.createElement("script"); wrapper.type = "text/javascript"; wrapper.onload = player_load; wrapper.src = "//player.video.wowza.com/theo/theoplayer-wowza.js" document.getElementsByTagName("head")[0].appendChild(wrapper); } function load() { // Insert default THEO Player UI var ls = document.createElement('link'); ls.rel='stylesheet'; ls.href= "https://cdn.myth.theoplayer.com/823e42ef-302f-407e-8e77-e80644fb604a/ui.css"; document.getElementsByTagName('head')[0].appendChild(ls); // Insert Wowza THEO Player UI var ls2 = document.createElement('link'); ls2.rel='stylesheet'; ls2.href= "//player.video.wowza.com/theo/theoplayer-wowza.css"; document.getElementsByTagName('head')[0].appendChild(ls2); // Insert the inline CSS so that we can style the player var node = document.createElement('style'); node.innerHTML = '// THEO Player Custom Styles\n'; document.getElementsByTagName("head")[0].appendChild(node); var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true; script.onload = loadWowzaTheoLibrary; script.src = "https://cdn.myth.theoplayer.com/823e42ef-302f-407e-8e77-e80644fb604a/THEOplayer.js"; document.getElementsByTagName("head")[0].appendChild(script); } // If we have a window and can attach an event then run the load function if (window.attachEvent) window.attachEvent('onload', load) else window.addEventListener('load', load, false); })();