/*! * $script.js JS loader & dependency manager * https://github.com/ded/script.js * (c) Dustin Diaz 2014 | License MIT */ (function (e, t) { typeof module != "undefined" && module.exports ? module.exports = t() : typeof define == "function" && define.amd ? define(t) : this[e] = t() })("$script", function () { function p(e, t) { for (var n = 0, i = e.length; n < i; ++n) if (!t(e[n])) return r; return 1 } function d(e, t) { p(e, function (e) { return !t(e) }) } function v(e, t, n) { function g(e) { return e.call ? e() : u[e] } function y() { if (!--h) { u[o] = 1, s && s(); for (var e in f) p(e.split("|"), g) && !d(f[e], g) && (f[e] = []) } } e = e[i] ? e : [e]; var r = t && t.call, s = r ? t : n, o = r ? e.join("") : t, h = e.length; return setTimeout(function () { d(e, function t(e, n) { if (e === null) return y(); e = !n && e.indexOf(".js") === -1 && !/^https?:\/\//.test(e) && c ? c + e + ".js" : e; if (l[e]) return o && (a[o] = 1), l[e] == 2 ? y() : setTimeout(function () { t(e, !0) }, 0); l[e] = 1, o && (a[o] = 1), m(e, y) }) }, 0), v } function m(n, r) { var i = e.createElement("script"), u; i.onload = i.onerror = i[o] = function () { if (i[s] && !/^c|loade/.test(i[s]) || u) return; i.onload = i[o] = null, u = 1, l[n] = 2, r() }, i.async = 1, i.src = h ? n + (n.indexOf("?") === -1 ? "?" : "&") + h : n, t.insertBefore(i, t.lastChild) } var e = document, t = e.getElementsByTagName("head")[0], n = "string", r = !1, i = "push", s = "readyState", o = "onreadystatechange", u = {}, a = {}, f = {}, l = {}, c, h; return v.get = m, v.order = function (e, t, n) { (function r(i) { i = e.shift(), e.length ? v(i, r) : v(i, t, n) })() }, v.path = function (e) { c = e }, v.urlArgs = function (e) { h = e }, v.ready = function (e, t, n) { e = e[i] ? e : [e]; var r = []; return !d(e, function (e) { u[e] || r[i](e) }) && p(e, function (e) { return u[e] }) ? t() : !function (e) { f[e] = f[e] || [], f[e][i](t), n && n(r) }(e.join("|")), v }, v.done = function (e) { v([null], e) }, v }) $script('//assets.livebox.cz/hls.js/0.12.4/hls.light.min.js', function () { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); var playerVersion = "7.2.7"; if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number { playerVersion = "7.2.7"; } else { playerVersion = "7.2.7"; } $script(['//assets.livebox.cz/flowplayer/'+playerVersion+'/flowplayer.min.js', '//embed.livebox.cz/ta3_v2/js/springstreams.js', '//embed.livebox.cz/ta3_v2/js/vast-client.js'], 'bundle') }) //$script(['//assets.livebox.cz/hls.js/0.12.1/hls.light.min.js'], 'bundle') var LiveboxPlayer = (function () { var my = {}; /** * jQuery.browser.mobile (http://detectmobilebrowser.com/) * * jQuery.browser.mobile will be true if the browser is a mobile device * **/ (function (a) { (jQuery.browser = jQuery.browser || {}).mobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(navigator.userAgent || navigator.vendor || window.opera); my.adsUrl = "//{1}/api/v1/livebox/video/{0}.html?token=M0W6Ie7A"; //my.adsUrl = "http://embed.livebox.cz/ta3_new/ads.xml?t=1"; my.adsStatUrl = "//{2}/api/livebox/v1/videoadvert/{0}/{1}.html?token=M0W6Ie7A"; my.RelatedUrl = "//{1}/api/livebox/v1/video/{0}/related.html?token=M0W6Ie7A"; my.SpringSensors = null; my.SpringsTrack = null; my.lastMini = 0; var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); my.playerVersion = "7.2.7"; if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number { my.playerVersion = "7.2.6"; } else { my.playerVersion = "7.2.7"; } my.Sources = "ta3_v2"; my.GaID = "UA-25441173-1"; my.Debug = false; my.options_mini = []; my.options_miniNRSR = []; my.options_vod = []; my.options_hide = []; my.options_live = []; my.isImpressionStart = false; my.isImpressionEnd = false; my.extractDomain = function(url) { if (url.indexOf("://") > -1) { domain = url.split('/')[2]; } else { domain = url.split('/')[0]; } domain = domain.split(':')[0]; return domain; } my.live = function (options) { my.options_live.push(options); $script.ready('bundle', function () { $script(['//embed.livebox.cz/' + my.Sources + '/live-source.js'], function () { for (var i in my.options_live) { $("#" + my.options_live[i].dom_id).css({ "position": "relative", "width": my.options_live[i].width, "height": my.options_live[i].height }); var url = LiveboxPlayerLiveSource.embedurl[0]["src"].replace("{0}", my.options_live[i].videoId); my.init_live($.extend({}, my.options_live[i], { hls: url, live: true, autoplay: typeof my.options_live[i].autoplay == "undefined" ? true : my.options_live[i].autoplay })); } }); }); }, my.liveNRSR = function (options) { my.options_live.push(options); $script.ready('bundle', function () { $script(['//embed.livebox.cz/' + my.Sources + '/nrsr-source.js'], function () { for (var i in my.options_live) { $("#" + my.options_live[i].dom_id).css({ "position": "relative", "width": my.options_live[i].width, "height": my.options_live[i].height }); $("#" + my.options_live[i].dom_id).addClass("lbx-nrsr"); var url = LiveboxPlayerMiniNrSrSource.embedurl[0]["src"].replace("{0}", my.options_live[i].videoId); my.init_liveNRSR($.extend({}, my.options_live[i], { hls: url, live: true, autoplay: typeof my.options_live[i].autoplay == "undefined" ? true : my.options_live[i].autoplay })); } }); }); }, my.archiv = function (options) { my.options_vod.push(options); $script.ready('bundle', function () { $script(['//embed.livebox.cz/' + my.Sources + '/com-source.js', '//embed.livebox.cz/' + my.Sources + '/vod-source.js'], function () { for (var i in my.options_vod) { $("#" + my.options_vod[i].dom_id).css({ "position": "relative", "width": my.options_vod[i].width, "height": my.options_vod[i].height }); var url = LiveboxPlayerSource.embedurl[0]["src"].replace("{0}", my.options_vod[i].videoId); if (my.options_vod[i].videoId.match("^[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}")) { url = url.replace("VideotekaEncoder", "Videoteka"); } my.real_vod($.extend({}, my.options_vod[i], { hls: url, live: false, autoplay: typeof my.options_vod[i].autoplay == "undefined" ? false : my.options_vod[i].autoplay })); } }); }); }, my.hide = function (options) { my.options_hide.push(options); $script.ready('bundle', function () { for (var i in my.options_hide) { $("#" + my.options_hide[i].dom_id).css({ "position": "relative", "width": my.options_hide[i].width, "height": my.options_hide[i].height }); my.init_vod_hide($.extend({}, my.options_hide[i], { hls: "", live: false, autoplay: typeof my.options_hide[i].autoplay == "undefined" ? false : my.options_hide[i].autoplay })); } }); }, my.miniplayer = function (options) { if(my.options_mini.length==0) { my.options_mini.push(options); } if(my.lastMini>0) { //flowplayer(my.lastMini).shutdown(); } $script.ready('bundle', function () { $script(['//embed.livebox.cz/' + my.Sources + '/mini-source.js?nocache='+my.randomIntFromInterval(0, 1000)], function () { for (var i in my.options_mini) { $("#" + my.options_mini[i].dom_id).css({ "position": "relative", "width": "204", "height": "115" }); $("#" + my.options_mini[i].dom_id).addClass("lbx-mini"); var url = LiveboxPlayerMiniSource.embedurl[0]["src"].replace("{0}", my.options_mini[i].videoId); my.init_mini($.extend({}, my.options_mini[i], { hls: url, live: true, autoplay: typeof my.options_mini[i].autoplay == "undefined" ? true : my.options_mini[i].autoplay })); } }); }); }, my.miniplayerNRSR = function (options) { if(my.options_miniNRSR.length==0) { my.options_miniNRSR.push(options); } if(my.lastMini>0) { //flowplayer(my.lastMini).shutdown(); } $script.ready('bundle', function () { $script(['//embed.livebox.cz/' + my.Sources + '/nrsr-source.js'], function () { for (var i in my.options_miniNRSR) { $("#" + my.options_miniNRSR[i].dom_id).css({ "position": "relative", "width": "204", "height": "160" }); $("#" + my.options_miniNRSR[i].dom_id).addClass("lbx-mini-nrsr"); var url = LiveboxPlayerMiniNrSrSource.embedurl[0]["src"].replace("{0}", my.options_miniNRSR[i].videoId); my.init_miniNRSR($.extend({}, my.options_miniNRSR[i], { hls: url, live: true, autoplay: typeof my.options_miniNRSR[i].autoplay == "undefined" ? true : my.options_miniNRSR[i].autoplay })); } }); }); }, my.init_live = function (opt) { my.SpringsStreamsInit(); //global config $("#"+opt.dom_id).addClass("fp-playful fp-mute fp-slim no-buffer fp-edgy fp-outlined") flowplayer(function (api, root) { var fsbutton = root.querySelector(".fp-fullscreen"); var fpelapsed = root.querySelector(".fp-elapsed"); api.on("ready", function () { root.querySelector(".fp-controls").appendChild(fsbutton); root.querySelector(".fp-controls").insertBefore(fpelapsed, root.querySelector(".fp-volume")); root.querySelector(".fp-duration").style.display = 'none'; }); api.on("stop pause finish", function() { $("#" + opt.dom_id + " .fp-playbtn").attr("title", "Prehrať") }); api.on("mute", function() { if(api.muted) { $("#" + opt.dom_id + " .fp-volumebtn").attr("title", "Zrušiť stlmenie"); } else { $("#" + opt.dom_id + " .fp-volumebtn").attr("title", "Stlmiť"); } }); api.on("resume", function() { $("#" + opt.dom_id + " .fp-playbtn").attr("title", "Zastaviť") }); api.on("fullscreen", function() { $("#" + opt.dom_id + " .fp-fullscreen").attr("title", "Normálna obrazovka"); }); api.on("fullscreen-exit", function() { $("#" + opt.dom_id + " .fp-fullscreen").attr("title", "Celá obrazovka"); }); }); var timer; var initialDelay = 20; customErrors = flowplayer.defaults.errors.slice(0), customError = "

We are sorry, currently no live stream available.

" + "

Retrying in " + initialDelay + " seconds ...

", errImage = new Image(); errImage.src = "//embed.livebox.cz/ta3_v2/css/video-background-xl.jpg"; customErrors[2] = customError; customErrors[4] = customError; player = flowplayer(document.getElementById(opt.dom_id), { /* errors: [ '', 'Video loading aborted', 'Network error', 'Video not properly encoded', 'Video file not found', '', 'Skin not found', 'SWF file not found', 'Subtitles not found', 'Invalid RTMP URL', '' ], errorUrls: ['','','','','','','','','','',''], */ key: "$332484820039575", embed: false, poster: opt.poster, autoplay: true, mutedAutoplay: true, native_fullscreen: true, fullscreen: true, embed: false, share: false, swfHls: '//assets.livebox.cz/flowplayer/'+my.playerVersion+'/flowplayerhls.swf', live: true, hlsQualities: false, errors: customErrors, analytics: my.GaID, debug: my.Debug, hlsjs: { listeners: ["hlsLevelSwitch", "hlsError"], startLevel: 0, capLevelToPlayerSize: true, debug: my.Debug, xhrSetup: function (xhr, url) { xhr.addEventListener("error", function () { // only react to playlist loading failures //if (url.lastIndexOf(".m3u8") === url.length - 5) { if(url.indexOf(".m3u8")!=-1) { // intentionally throw network error //player.trigger("error", [player, {code: 2}]); } }); xhr.addEventListener("readystatechange", function (e) { var xstatus = e.currentTarget.status; if (xhr.readyState === 4 && xstatus >= 400 && xstatus < 499) { // intentionally throw Video file not found error player.trigger("error", [player, {code: 4}]); } }); } }, flashls: { // limit amount of retries to load hls manifests in Flash }, clip: { sources: [{ type: "application/x-mpegurl", src: opt.hls, playSend: false, name: "LIVE" }] } }).on("ready", function (e, api, video) { api.mute(false); api.volume(0.6); my.SpringsTrack = my.SpringSensors.track(opt.dom_id, my.getSpringsDescription(opt.dom_id), my.Adapter(opt.dom_id)); if (my.Debug) { var engineName = api.engine.engineName; console.log("player engine: " + engineName); console.log("video type: " + video.type); if (engineName !== "hlsjs") { console.log("video source: " + video.src); } } }).on("load", function (e, api) { api.mute(false); api.volume(0.6); var container = document.getElementById(opt.dom_id); var help = container.querySelector(".fp-player .fp-ui"); }).on("finish", function (e, api) { }).on("stop", function (e, api) { }).on("unload", function (e, api) { }).on("progress", function (e, api, currentTime) { if (my.Debug) { var hlsengine = api.engine.hlsjs; if (hlsengine) { var current = hlsengine.currentLevel; level = hlsengine.levels[current], info = api.conf.clip.live ? level.bitrate / 1000 + " kbps" : level.height + "p"; console.log("HLS level " + (current > -1 ? current + ": " + info : "")); } } if(!api.video.playSend) { if(currentTime>1) { api.video.playSend = true; if(typeof opt.cbPlay !== "undefined") { eval(opt.cbPlay + "('"+opt.videoId+"')"); } } } }).on("error", function (e, api, err) { var delay = 20; var container = document.getElementById(opt.dom_id); //var header = container.querySelector(".fp-message h2"); //var detail = container.querySelector(".fp-message p"); var delay = initialDelay; var container = document.getElementById(opt.dom_id); clearInterval(timer); if (err.code === 2 || err.code === 4) { container.className += " is-offline"; if (flowplayer.support.flashVideo) { api.one("flashdisabled", function () { container.querySelector(".fp-flash-disabled").style.display = "none"; }); } timer = setInterval(function () { var messageElement = container.querySelector(".fp-ui .fp-message"); delay -= 1; if (delay && messageElement) { messageElement.querySelector("span").innerHTML = delay; // only for disconnected user: messageElement.style.backgroundImage = "url(" + errImage.src + ")"; } else { clearInterval(timer); api.error = api.loading = false; if (messageElement) { container.querySelector(".fp-ui").removeChild(messageElement); } container.className = container.className.replace(/\bis-(error|offline)\b/g, ""); api.load({ sources: [{ live: true, type: "application/x-mpegurl", src: opt.hls, name: "LIVE" }] }); } }, 1000); } else if(err.code === 5 || err.code === 10) { $("#"+opt.dom_id+" .fp-message h2").css({"color": "white", "font-size": "100%", "text-shadow": "none"}); header.innerHTML = "Vaša verzia prehliadača nepodporuje prehrávanie videa. Aktualizujte si prehliadač."; detail.innerHTML = ""; } }); my.localize(opt.dom_id, "sk", "//embed.livebox.cz/ta3_v2/img/novideo2.jpg"); }, my.init_liveNRSR = function (opt) { my.SpringsStreamsInit(); $("#"+opt.dom_id).addClass("fp-playful fp-mute fp-slim no-buffer fp-edgy fp-outlined") flowplayer(function (api, root) { var fsbutton = root.querySelector(".fp-fullscreen"); var fpelapsed = root.querySelector(".fp-elapsed"); api.on("ready", function () { root.querySelector(".fp-controls").appendChild(fsbutton); root.querySelector(".fp-controls").insertBefore(fpelapsed, root.querySelector(".fp-volume")); root.querySelector(".fp-duration").style.display = 'none'; }); api.on("stop pause finish", function() { $("#" + opt.dom_id + " .fp-playbtn").attr("title", "Prehrať") }); api.on("mute", function() { if(api.muted) { $("#" + opt.dom_id + " .fp-volumebtn").attr("title", "Zrušiť stlmenie"); } else { $("#" + opt.dom_id + " .fp-volumebtn").attr("title", "Stlmiť"); } }); api.on("resume", function() { $("#" + opt.dom_id + " .fp-playbtn").attr("title", "Zastaviť") }); api.on("fullscreen", function() { $("#" + opt.dom_id + " .fp-fullscreen").attr("title", "Normálna obrazovka"); }); api.on("fullscreen-exit", function() { $("#" + opt.dom_id + " .fp-fullscreen").attr("title", "Celá obrazovka"); }); }); /* flowplayer(function (api, root) { var fsbutton = root.querySelector(".fp-fullscreen"); fsbutton.remove(); var fsButton = document.createElement("a"); fsButton.setAttribute("class", "fp-fullscreen"); root.querySelector(".fp-controls").appendChild(fsButton); }); */ var timer; var initialDelay = 20; customErrors = flowplayer.defaults.errors.slice(0), customError = "

We are sorry, currently no live stream available.

" + "

Retrying in " + initialDelay + " seconds ...

", errImage = new Image(); errImage.src = "//embed.livebox.cz/ta3_v2/css/video-background-xl.jpg"; customErrors[2] = customError; customErrors[4] = customError; player = flowplayer(document.getElementById(opt.dom_id), { key: "$332484820039575", embed: false, poster: opt.poster, autoplay: true, mutedAutoplay: true, native_fullscreen: true, fullscreen: true, embed: false, share: false, swfHls: '//assets.livebox.cz/flowplayer/'+my.playerVersion+'/flowplayerhls.swf', live: true, hlsQualities: false, errors: customErrors, analytics: my.GaID, debug: my.Debug, hlsjs: { listeners: ["hlsLevelSwitch", "hlsError"], startLevel: 0, capLevelToPlayerSize: true, debug: my.Debug, xhrSetup: function (xhr, url) { xhr.addEventListener("error", function () { // only react to playlist loading failures //if (url.lastIndexOf(".m3u8") === url.length - 5) { if(url.indexOf(".m3u8")!=-1) { // intentionally throw network error //player.trigger("error", [player, {code: 2}]); } }); xhr.addEventListener("readystatechange", function (e) { var xstatus = e.currentTarget.status; if (xhr.readyState === 4 && xstatus >= 400 && xstatus < 499) { // intentionally throw Video file not found error player.trigger("error", [player, {code: 4}]); } }); } }, flashls: { // limit amount of retries to load hls manifests in Flash }, clip: { sources: [{ type: "application/x-mpegurl", src: opt.hls, playSend: false, name: "VOD" }] } }).on("ready", function (e, api, video) { api.mute(false); api.volume(0.6); my.SpringsTrack = my.SpringSensors.track(opt.dom_id, my.getSpringsDescription(opt.dom_id), my.Adapter(opt.dom_id)); if (my.Debug) { var engineName = api.engine.engineName; console.log("player engine: " + engineName); console.log("video type: " + video.type); if (engineName !== "hlsjs") { console.log("video source: " + video.src); } } }).on("load", function (e, api) { var container = document.getElementById(opt.dom_id); var help = container.querySelector(".fp-player .fp-ui"); }).on("finish", function (e, api) { }).on("stop", function (e, api) { }).on("unload", function (e, api) { }).on("progress", function (e, api, currentTime) { if (my.Debug) { var hlsengine = api.engine.hlsjs; if (hlsengine) { var current = hlsengine.currentLevel; level = hlsengine.levels[current], info = api.conf.clip.live ? level.bitrate / 1000 + " kbps" : level.height + "p"; console.log("HLS level " + (current > -1 ? current + ": " + info : "")); } } if(!api.video.playSend) { if(currentTime>1) { api.video.playSend = true; if(typeof opt.cbPlay !== "undefined") { eval(opt.cbPlay + "('"+opt.videoId+"')"); } } } }).on("error", function (e, api, err) { var delay = 20; var container = document.getElementById(opt.dom_id); var header = container.querySelector(".fp-message h2"); var detail = container.querySelector(".fp-message p"); var delay = initialDelay; var container = document.getElementById(opt.dom_id); clearInterval(timer); if (err.code === 2 || err.code === 4) { container.className += " is-offline"; if (flowplayer.support.flashVideo) { api.one("flashdisabled", function () { container.querySelector(".fp-flash-disabled").style.display = "none"; }); } timer = setInterval(function () { var messageElement = container.querySelector(".fp-ui .fp-message"); delay -= 1; if (delay && messageElement) { messageElement.querySelector("span").innerHTML = delay; // only for disconnected user: messageElement.style.backgroundImage = "url(" + errImage.src + ")"; } else { clearInterval(timer); api.error = api.loading = false; if (messageElement) { container.querySelector(".fp-ui").removeChild(messageElement); } container.className = container.className.replace(/\bis-(error|offline)\b/g, ""); api.load({ sources: [{ live: true, type: "application/x-mpegurl", src: opt.hls, name: "LIVE" }] }); } }, 1000); } else if(err.code === 5 || err.code === 10) { $("#"+opt.dom_id+" .fp-message h2").css({"color": "white", "font-size": "100%", "text-shadow": "none"}); header.innerHTML = "Vaša verzia prehliadača nepodporuje prehrávanie videa. Aktualizujte si prehliadač."; detail.innerHTML = ""; } /**********************************************************/ /* var delay = 20; var container = document.getElementById(opt.dom_id); var header = container.querySelector(".fp-message h2"); var detail = container.querySelector(".fp-message p"); if (err.code === 4 || err.code === 9) { header.innerHTML = "We are sorry, currently no live stream available."; detail.innerHTML = "Retrying in " + delay + " seconds ..."; header.innerHTML = ""; detail.innerHTML = ""; $("#"+opt.dom_id+".flowplayer.is-error").css({"border-width": "0px"}) $("#"+opt.dom_id+".flowplayer.is-error .fp-message").css({"padding": "0", "background-image": "url(//embed.livebox.cz/ta3_v2/img/nrsr-offline-xl.jpg)", "background-size": "contain"}); if (flowplayer.support.flashVideo) { api.one("flashdisabled", function () { container.querySelector(".fp-flash-disabled").style.display = "none"; }); } timer = setInterval(function () { delay -= 1; if (!delay) { clearInterval(timer); api.error = api.loading = false; api.load(api.conf.clip); } }, 1000); } */ }); my.localize(opt.dom_id, "sk", "//embed.livebox.cz/ta3_v2/img/nrsr-offline-xl.jpg"); }, my.init_mini = function (opt) { $("#"+opt.dom_id).addClass("fp-playful fp-mute fp-slim no-buffer fp-edgy fp-outlined") flowplayer(function (api, root) { var fsbutton = root.querySelector(".fp-fullscreen"); api.on("ready", function (e, api, video) { root.querySelector(".fp-controls").appendChild(fsbutton); $("#" + opt.dom_id + " .fp-controls").hide(); $("#" + opt.dom_id + " .fp-time").hide(); }); }); $("#" + opt.dom_id).mouseover(function () { //flowplayer(document.getElementById(opt.dom_id)).mute(false); }) $("#" + opt.dom_id).mouseleave(function () { //flowplayer(document.getElementById(opt.dom_id)).mute(true); }) flowplayer(document.getElementById(opt.dom_id), { errors: [ // video exceptions '', 'Video loading aborted', 'Network error', 'Video not properly encoded', 'Video file not found', // player exceptions '', 'Skin not found', 'SWF file not found', 'Subtitles not found', 'Invalid RTMP URL', '' ], errorUrls: ['','','','','','','','','','',''], key: "$332484820039575", embed: false, poster: opt.poster, autoplay: true, mutedAutoplay: true, native_fullscreen: true, fullscreen: true, embed: false, share: false, swfHls: '//assets.livebox.cz/flowplayer/'+my.playerVersion+'/flowplayerhls.swf', live: true, hlsjs: { bufferWhilePaused: false }, hlsQualities: false, //errors: customErrors, analytics: my.GaID, debug: my.Debug, clip: { sources: [{ type: "application/x-mpegurl", src: opt.hls, name: "VOD" }] } }).on("ready", function (e, api, video) { api.mute(true); api.play(); if (my.Debug) { var engineName = api.engine.engineName; console.log("player engine: " + engineName); console.log("video type: " + video.type); if (engineName !== "hlsjs") { console.log("video source: " + video.src); } } }).on("error", function (e, api, ex) { var container = document.getElementById(opt.dom_id); var header = container.querySelector(".fp-message h2"); var detail = container.querySelector(".fp-message p"); $(detail).hide(); if (ex.code === 5 || ex.code === 10) { my.customError(opt.dom_id, "//embed.livebox.cz/ta3_v2/img/novideo.jpg"); } else if(ex.code === 4) { my.customError(opt.dom_id, "//embed.livebox.cz/ta3_v2/img/offline-mini.png"); } }) .on("finish", function (e, api) { }).on("stop", function (e, api) { }).on("unload", function (e, api) { }).on("progress", function (e, api, currentTime) { if (my.Debug) { var hlsengine = api.engine.hlsjs; if (hlsengine) { var current = hlsengine.currentLevel; level = hlsengine.levels[current], info = api.conf.clip.live ? level.bitrate / 1000 + " kbps" : level.height + "p"; console.log("HLS level " + (current > -1 ? current + ": " + info : "")); } } }); my.localize(opt.dom_id, "sk", "//embed.livebox.cz/ta3_v2/img/novideo.jpg"); my.lastMini = $("#"+opt.dom_id).attr("data-flowplayer-instance-id"); }, my.init_miniNRSR = function (opt) { $("#"+opt.dom_id).addClass("fp-playful fp-mute fp-slim no-buffer fp-edgy fp-outlined") flowplayer(function (api, root) { api.on("ready", function (e, api, video) { $("#" + opt.dom_id + " .fp-controls").hide(); $("#" + opt.dom_id + " .fp-time").hide(); $("#" + opt.dom_id + " .fp-fullscreen").remove(); }); }); $("#" + opt.dom_id).mouseover(function () { flowplayer(document.getElementById(opt.dom_id)).mute(false); }); $("#" + opt.dom_id).mouseleave(function () { flowplayer(document.getElementById(opt.dom_id)).mute(true); }); flowplayer(document.getElementById(opt.dom_id), { errors: [ // video exceptions '', 'Video loading aborted', 'Network error', 'Video not properly encoded', 'Video file not found', // player exceptions '', 'Skin not found', 'SWF file not found', 'Subtitles not found', 'Invalid RTMP URL', '' ], key: "$332484820039575", embed: false, poster: opt.poster, autoplay: true, mutedAutoplay: true, native_fullscreen: true, aspectRatio: 0.78, ratio: 0.78, //adaptiveRatio: true, fullscreen: true, embed: false, share: false, swfHls: '//assets.livebox.cz/flowplayer/'+my.playerVersion+'/flowplayerhls.swf', live: true, hlsQualities: false, //errors: customErrors, analytics: my.GaID, debug: my.Debug, hlsjs: { debug: my.Debug, bufferWhilePaused: false }, hlsQualities: false, clip: { sources: [{ type: "application/x-mpegurl", src: opt.hls, name: "VOD" }] } }).on("ready", function (e, api, video) { api.mute(true); api.play(); if (my.Debug) { var engineName = api.engine.engineName; console.log("player engine: " + engineName); console.log("video type: " + video.type); if (engineName !== "hlsjs") { console.log("video source: " + video.src); } } $("#"+opt.dom_id+" video").width(214); $("#"+opt.dom_id+" video").height(170); }).on("load", function (e, api) { var container = document.getElementById(opt.dom_id); var help = container.querySelector(".fp-player .fp-ui"); }).on("error", function (e, api, ex) { var container = document.getElementById(opt.dom_id); var header = container.querySelector(".fp-message h2"); var bg = container.querySelector(".fp-message"); var detail = container.querySelector(".fp-message p"); if (ex.code === 5 || ex.code === 10) { my.customError(opt.dom_id, "//embed.livebox.cz/ta3_v2/img/novideo.jpg"); } else if(ex.code === 4) { my.customError(opt.dom_id, "//embed.livebox.cz/ta3_v2/img/nrsr-offline-s-160.jpg"); } }) .on("finish", function (e, api) { }).on("stop", function (e, api) { }).on("unload", function (e, api) { }).on("progress", function (e, api, currentTime) { if (my.Debug) { var hlsengine = api.engine.hlsjs; if (hlsengine) { var current = hlsengine.currentLevel; level = hlsengine.levels[current], info = api.conf.clip.live ? level.bitrate / 1000 + " kbps" : level.height + "p"; console.log("HLS level " + (current > -1 ? current + ": " + info : "")); } } }); my.localize(opt.dom_id, "sk", "//embed.livebox.cz/ta3_v2/img/nrsr-offline-s-160.jpg"); my.lastMini = $("#"+opt.dom_id).attr("data-flowplayer-instance-id"); }, my.getSpringsDescription = function (domID) { if(typeof flowplayer("#"+domID) == "object") { var desc = { "stream":document.location.pathname, //"duration":flowplayer("#"+domID).video.duration, // in seconds "sx":$("#"+domID).width(), "sy":$("#"+domID).outerHeight(), "ct": flowplayer("#"+domID).video.name, "cq": my.getFileName(flowplayer("#"+domID).video.src, flowplayer("#"+domID).video.name) } return desc; } else { return {}; } } my.getFileName = function(arg, name){ if(name=="LIVE") { var myRegexp = /([a-z0-9_-]*)\.smil/g; var match = myRegexp.exec(arg); return (match[1]); // abc } else if(name=="VOD") { var myRegexp = /smil:([a-zA-Z0-9_-]*)(_d\.smil|\/playlist)/g; var match = myRegexp.exec(arg); return (match[1]); // abc } else { return arg; } } my.Adapter = function(domID) { return { "getMeta": function(id) { return { "pl": "flowplayer", "plv": my.playerVersion, "sx":screen.width, "sy":screen.height } }, "getDuration": function(id) { if(flowplayer("#"+domID).video.name=="LIVE") return 0; else return parseInt(flowplayer("#"+domID).video.duration); }, "getPosition": function(id){ if(typeof flowplayer("#"+domID)=="object" && typeof flowplayer("#"+domID).video=="object" && typeof flowplayer("#"+domID).video.time=="number") { if(flowplayer("#"+domID).video.name=="LIVE") { //return new Date().getTime() / 1000; return parseInt(flowplayer("#"+domID).video.time) } else { return parseInt(flowplayer("#"+domID).video.time) } } else { return 0; } } }; } my.SpringsStreamsInit = function() { if(typeof SpringStreams == "function") { my.SpringSensors = new SpringStreams("ta3"); } } my.findAds = function(mediaFiles) { var obj = null; $.each(mediaFiles, function( index, value ) { if(value.mimeType=="video/mp4") { obj = value; //console.log(value); } }); //if(typeof mediaFiles.find(el => el.mimeType=="video/mp4")!="undefined") //{ // var i = mediaFiles.filter(el => el.mimeType=="video/mp4").length; // obj = mediaFiles.filter(el => el.mimeType=="video/mp4")[i-1]; //} //else{ //} return obj; } my.real_vod = function (options) { my.SpringsStreamsInit(); if(typeof options.skipAds=="undefined") { options.skipAds = false; } if(options.skipAds) { var ads = []; options = $.extend({}, options, { ads: ads }); my.init_vod(options); } else { //var vast = "https://adx.adform.net/adx/?mid=696435&t=2&mkv=length:none"; var vastPreroll = "https://pubads.g.doubleclick.net/gampad/live/ads?iu=/77283581/video&description_url=[placeholder]&tfcd=0&npa=0&sz=640x480&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=&nofb=1"; vastPreroll = vastPreroll.replace("[placeholder]", window.location); var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number { var ads = []; options = $.extend({}, options, { adsPreroll: ads }); my.real_postroll(options); } else // If another browser, return 0 { var vastClient = new VAST.VASTClient(); vastClient.get(vastPreroll) .then(function(res) { var id = res.ads[0].id; var title = res.ads[0].title; var mediaFiles = res.ads[0].creatives[0].mediaFiles; var trackingEvents = res.ads[0].creatives[0].trackingEvents //$(".id").html("id: " + id); //$(".title").html("title: " + title); //$.each(mediaFiles, function( index, value ) { // $(".mediaFiles ul").append("
  • "+value.fileURL+" (" + value.width +"x"+value.height+") ← "+value.mimeType+"
  • ") //}); //$.each(trackingEvents, function( index, value ) { //$(".trackingEvents ul").append("
  • "+index+":"+value+"
  • ") //} ); var adsObject = my.findAds(mediaFiles); console.log(adsObject) if(adsObject!=null) { var ads = []; ads.push({ url: adsObject.fileURL, mimeType: adsObject.mimeType, vast: new VAST.VASTTracker(new VAST.VASTClient(), res.ads[0], res.ads[0].creatives[0]) }) options = $.extend({}, options, { adsPreroll: ads }); } my.real_postroll(options); }) .catch(function(err) { var ads = []; options = $.extend({}, options, { adsPreroll: ads }); my.real_postroll(options); }); } } }, my.real_postroll = function (options) { console.log("postroll"); if(typeof options.skipAds=="undefined") { options.skipAds = false; } if(options.skipAds) { var ads = []; options = $.extend({}, options, { ads: ads }); my.init_vod(options); } else { var vastPostroll = "https://pubads.g.doubleclick.net/gampad/live/ads?iu=/77283581/video-post-roll&description_url=[placeholder]&tfcd=0&npa=0&sz=640x480&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator="; vastPostroll = vastPostroll.replace("[placeholder]", window.location); var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number { var ads = []; options = $.extend({}, options, { adsPostroll: ads }); my.init_vod(options); } else { var vastClient = new VAST.VASTClient(); vastClient.get(vastPostroll) .then(function(res) { var id = res.ads[0].id; var title = res.ads[0].title; var mediaFiles = res.ads[0].creatives[0].mediaFiles; var trackingEvents = res.ads[0].creatives[0].trackingEvents //$(".id").html("id: " + id); //$(".title").html("title: " + title); //$.each(mediaFiles, function( index, value ) { // $(".mediaFiles ul").append("
  • "+value.fileURL+" (" + value.width +"x"+value.height+") ← "+value.mimeType+"
  • ") //}); //$.each(trackingEvents, function( index, value ) { //$(".trackingEvents ul").append("
  • "+index+":"+value+"
  • ") //} ); var adsObject = my.findAds(mediaFiles); console.log(adsObject) if(adsObject!=null) { var ads = []; ads.push({ url: adsObject.fileURL, mimeType: adsObject.mimeType, vast: new VAST.VASTTracker(new VAST.VASTClient(), res.ads[0], res.ads[0].creatives[0]) }) options = $.extend({}, options, { adsPostroll: ads }); } my.init_vod(options); }) .catch(function(err) { var ads = []; options = $.extend({}, options, { adsPostroll: ads }); my.init_vod(options); }); } } }, my.init_vod = function (opt) { var playlist = []; if(typeof opt.adsPreroll != "undefined") { for (var i = 0; i < opt.adsPreroll.length; i++) { playlist.push({ sources: [{ type: opt.adsPreroll[i].mimeType, src: opt.adsPreroll[i].url, vast: opt.adsPreroll[i].vast, name: "ads", idx: i }] }) } } playlist.push({ sources: [{ type: "application/x-mpegurl", src: opt.hls, playSend: false, name: "VOD" }] }) if(typeof opt.adsPostroll != "undefined") { for (var i = 0; i < opt.adsPostroll.length; i++) { playlist.push({ sources: [{ type: opt.adsPostroll[i].mimeType, src: opt.adsPostroll[i].url, vast: opt.adsPostroll[i].vast, name: "ads", idx: i }] }) } } customErrors = flowplayer.defaults.errors.slice(0), customErrors[2] = ""; customErrors[4] = ""; $("#"+opt.dom_id).addClass("fp-playful fp-mute fp-slim no-buffer fp-edgy fp-outlined") flowplayer(function (api, root) { var fsbutton = root.querySelector(".fp-fullscreen"); var fpelapsed = root.querySelector(".fp-elapsed"); api.on("ready", function () { root.querySelector(".fp-controls").appendChild(fsbutton); root.querySelector(".fp-controls").insertBefore(fpelapsed, root.querySelector(".fp-volume")); root.querySelector(".fp-duration").style.display = 'none'; }); api.on("stop pause finish", function() { $("#" + opt.dom_id + " .fp-playbtn").attr("title", "Prehrať") }); api.on("mute", function() { if(api.muted) { $("#" + opt.dom_id + " .fp-volumebtn").attr("title", "Zrušiť stlmenie"); } else { $("#" + opt.dom_id + " .fp-volumebtn").attr("title", "Stlmiť"); } }); api.on("resume", function() { $("#" + opt.dom_id + " .fp-playbtn").attr("title", "Zastaviť"); $("#" + opt.dom_id + " .lbx-related-wrap").empty(); }); api.on("fullscreen", function() { $("#" + opt.dom_id + " .fp-fullscreen").attr("title", "Normálna obrazovka"); }); api.on("fullscreen-exit", function() { $("#" + opt.dom_id + " .fp-fullscreen").attr("title", "Celá obrazovka"); }); }); //global config /* flowplayer(function (api, root) { var fsbutton = $("#"+root.id+" .fp-fullscreen"); if(fsbutton!=null) { fsbutton.remove(); } var fsButton = document.createElement("a"); fsButton.setAttribute("class", "fp-fullscreen"); root.querySelector(".fp-controls").appendChild(fsButton); }); */ flowplayer(document.getElementById(opt.dom_id), { errors: [ // video exceptions '', 'Video loading aborted', 'Network error', 'Video not properly encoded', 'Video file not found', // player exceptions '', 'Skin not found', 'SWF file not found', 'Subtitles not found', 'Invalid RTMP URL', '' ], errorUrls: ['','','','','','','','','','',''], key: "$332484820039575", splash: opt.autoplay ? false : true, embed: false, analytics: my.GaID, poster: opt.poster, autoplay: opt.autoplay, mutedAutoplay: opt.autoplay, native_fullscreen: true, fullscreen: true, embed: false, share: false, swfHls: '//assets.livebox.cz/flowplayer/'+my.playerVersion+'/flowplayerhls.swf', live: false, hlsQualities: false, errors: customErrors, analytics: my.GaID, debug: my.Debug, hlsjs: { startLevel: 0, capLevelToPlayerSize: true, debug: my.Debug }, hlsQualities: false, playlist: playlist }).on("error", function(e, api, ex) { var container = document.getElementById(opt.dom_id); var header = container.querySelector(".fp-message h2"); var detail = container.querySelector(".fp-message p"); if (ex.code === 5 || ex.code === 10) { my.customError(opt.dom_id, "//embed.livebox.cz/ta3_v2/img/novideo2.jpg"); } }).on("ready", function (e, api, video) { api.mute(false); api.volumeLevel = 0.8; my.isImpressionEnd = false; api.disable(video.name == "ads") if(my.SpringsTrack !=null) { my.unload(); } my.SpringsTrack = my.SpringSensors.track(opt.dom_id, my.getSpringsDescription(opt.dom_id), my.Adapter(opt.dom_id)); $("#" + opt.dom_id + " .fp-player").css({"background-color": "black"}); $("#" + opt.dom_id + " .lbx-related-wrap").hide(); if (video.name == "ads") { api.video.vast.setDuration(api.video.duration); $("#" + opt.dom_id + " .fp-ad-container").show(); $("#" + opt.dom_id + " .fp-player .fp-ad-container a").attr("href", api.video.vast.clickThroughURLTemplate); $("#" + opt.dom_id + " .fp-player .fp-ad-container a").click(function () { api.video.vast.click(); //my.impression(api.video.impression, "click"); }); if(!my.isImpressionStart) { api.video.vast.trackImpression(); my.isImpressionStart = true; //my.impression(api.video.impression, "start"); } } else { $("#" + opt.dom_id + " .fp-ad-container").hide(); } if ($("#" + opt.dom_id).find(".lbx-related-wrap").length == 0) { $("#" + opt.dom_id).append("") } if (my.Debug) { var engineName = api.engine.engineName; console.log("player engine: " + engineName); console.log("video type: " + video.type); if (engineName !== "hlsjs") { console.log("video source: " + video.src); } } }).on("load", function (e, api) { var container = document.getElementById(opt.dom_id); var help = container.querySelector(".fp-player .fp-ui"); }) .on("finish", function (e, api) { my.isImpressionStart = false; if (api.video.name == "ads") { if(!my.isImpressionEnd) { my.isImpressionEnd = true; api.video.vast.complete(); //my.impression(api.video.impression, "end"); } } if (api.video.is_last) { $("#" + opt.dom_id + " .fp-ad-container").hide(); if(typeof opt.cb === "undefined") { my.related(opt); } else { eval(opt.cb + "()"); } } }).on("stop", function (e, api) { }).on("unload", function (e, api) { $("#" + opt.dom_id + " .fp-ad-container").hide(); api.disable(false); }).on("progress", function (e, api, currentTime) { if (my.Debug) { var hlsengine = api.engine.hlsjs; if (hlsengine) { var current = hlsengine.currentLevel; level = hlsengine.levels[current], info = api.conf.clip.live ? level.bitrate / 1000 + " kbps" : level.height + "p"; console.log("HLS level " + (current > -1 ? current + ": " + info : "")); } } if (api.video.name == "ads") { api.video.vast.setProgress(currentTime); $("#" + opt.dom_id).addClass("no-arrow"); var skipDelay = api.video.vast.creative.duration; if(typeof api.video.vast.creative.skipDelay == "number") { skipDelay = api.video.vast.creative.skipDelay; } if (Math.round(skipDelay - currentTime) > 0) { $("#" + opt.dom_id + " .fp-ad-container .fp-title").off("click"); $("#" + opt.dom_id + " .fp-ad-container .fp-title").css({"cursor": "default"}); $("#" + opt.dom_id + " .fp-ad-container .fp-title").text("Preskočiť reklamu za " + Math.round(skipDelay - currentTime) + " s."); } else { api.disable(false); $("#" + opt.dom_id + " .fp-ad-container .fp-title").text("Preskočiť reklamu"); $("#" + opt.dom_id + " .fp-ad-container .fp-title").css({"cursor": "pointer"}); $("#" + opt.dom_id + " .fp-ad-container .fp-title").click(function () { my.isImpressionStart = false; $("#" + opt.dom_id + " .fp-ad-container").hide(); try{ api.video.vast.skip(); } catch(err){} my.isImpressionEnd = false; if(!flowplayer("#" + opt.dom_id).video.is_last) { flowplayer("#" + opt.dom_id).next(); } else { if(typeof api.video.duration!=="undefined") { flowplayer("#" + opt.dom_id).seek(flowplayer("#" + opt.dom_id).video.duration); $("#" + opt.dom_id + " .fp-ad-container").hide(); if(typeof opt.cb === "undefined") { my.related(opt); } else { eval(opt.cb + "()"); } } } }); } } else { //ubrat class "video-ads" if(!api.video.playSend) { if(currentTime>1) { api.video.playSend = true; if(typeof opt.cbPlay !== "undefined") { eval(opt.cbPlay + "('"+opt.videoId+"')"); } } } $("#" + opt.dom_id).removeClass("no-arrow"); } }); if (!jQuery.browser.mobile) { $("#" + opt.dom_id + " .fp-player").append("
    "); } else{ $("#" + opt.dom_id + " .fp-player").append("
    "); } my.localize(opt.dom_id, "sk", "//embed.livebox.cz/ta3_v2/img/novideo2.jpg"); } my.related = function(opt) { video = opt.videoId.replace(".mp4", "") var url = my.RelatedUrl.replace("{0}", video).replace("{1}", my.extractDomain(window.location.href)); try { var xhr; xhr = new window.XMLHttpRequest(); xhr.withCredentials = true; xhr.open('GET', url, true); xhr.send(); return xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { var ads = []; var s; var i = 0; var txt = ""; xmlDoc = $.parseXML(xhr.responseText), x = xmlDoc.getElementsByTagName("video"); var target = "_parent"; if (opt.dom_id == "embedplayer") { target = "_blank"; } var rw = 176; var rh = 168; var gap = 40; var margin = 40; var w = $("#" + opt.dom_id).width(); var h = $("#" + opt.dom_id).innerHeight(); rw = (w / 2) - (gap / 2) - margin; rh = (h / 2) - (2 * margin); rh = rw * 0.5625; if($("#" + opt.dom_id).find(".lbx-related-wrap").length!=0) { $("#" + opt.dom_id + " .lbx-related-wrap").empty(); for (i = 0; i < x.length; i++) { switch (i) { case 0: $("#" + opt.dom_id + " .lbx-related-wrap").append("") break; case 1: $("#" + opt.dom_id + " .lbx-related-wrap").append("") break; case 2: $("#" + opt.dom_id + " .lbx-related-wrap").append("") break; case 3: $("#" + opt.dom_id + " .lbx-related-wrap").append("") break; default: } } $("#" + opt.dom_id + " .lbx-related-wrap").append("
    Prehrať znova
    "); $("#" + opt.dom_id + " .lbx-related-wrap").show(); } } else if(xhr.readyState === 4 && xhr.status === 404) { if ($("#" + opt.dom_id).find(".lbx-related-wrap").length != 0) { $("#" + opt.dom_id + " .lbx-related-wrap").empty(); $("#" + opt.dom_id + " .lbx-related-wrap").append("
    Prehrať znova
    "); $("#" + opt.dom_id + " .lbx-related-wrap").show(); } } else if (xhr.readyState === 4 && xhr.status === 0) { if ($("#" + opt.dom_id).find(".lbx-related-wrap").length != 0) { $("#" + opt.dom_id + " .lbx-related-wrap").empty(); $("#" + opt.dom_id + " .lbx-related-wrap").append("
    Prehrať znova
    "); $("#" + opt.dom_id + " .lbx-related-wrap").show(); } } } } catch (e) { } }, my.randomIntFromInterval = function(min, max) { // min and max included return Math.floor(Math.random() * (max - min + 1) + min); } my.customError = function(container, bg) { $("#"+container+".flowplayer.is-error").css({"border-width": "0px"}) $("#"+container+".flowplayer.is-error .fp-message").css({"padding": "0", "background-image": "url("+bg+")", "background-size": "cover"}); $("#"+container+" .fp-message h2").hide(); } my.localize = function(container, lang, bg) { $("#" + container + " .fp-ui").attr("title", ""); //$("#" + container + " .fp-playbtn").attr("title", "Prehrať/Zastaviť"); $("#" + container + " .fp-fullscreen").attr("title", "Celá obrazovka"); //$("#" + container + " .fp-volumebtn").attr("title", "Stlmiť/Zrušiť stlmenie"); $("#"+container+".flowplayer.is-error").css({"border-width": "0px"}) $("#"+container+".flowplayer.is-error .fp-message").css({"padding": "0", "background-image": "url("+bg+")", "background-size": "cover"}); $("#"+container+" .fp-message h2").hide(); } my.impression = function(video, action) { video = video.replace(".mp4", "") var url = my.adsStatUrl.replace("{0}", video).replace("{1}", action).replace("{2}", my.extractDomain(window.location.href)) try { var xhr; xhr = new window.XMLHttpRequest(); xhr.withCredentials = true; xhr.open('POST', url, true); xhr.send(); } catch (e) { } } my.init_vod_hide = function (opt) { $("#"+opt.dom_id).append(""); } my.unload = function() { if(my.SpringSensors != null) { my.SpringSensors.unload(); } } return my; }()); /* window.addEventListener('beforeunload', function(event) { LiveboxPlayer.unload(); }); */