(function (widget,cId,vids){ var _ONND_URL_EMBED = "https://video.onnetwork.tv" ; var _ONND_URL_CDN_EMBED = "https://cdn.onnetwork.tv" ; var overwrites = "" var iid=Date.now() * Math.floor( 1 + Math.random() * 100 ) + "1639" ; var uid="id"+iid; var playerLoaded = false ; var reelToStart = 0 ; var wConfig = {"playlistitems":[{"mid":"1792304","id":"1792304","length":"27","title":"Niesforna kie\u0142ba xD","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1792304_1.jpg","mposter_url":""},{"mid":"1792300","id":"1792300","length":"62","title":"Samoch\u00f3d jak z gry video","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1792300_2.jpg","mposter_url":""},{"mid":"1792298","id":"1792298","length":"15","title":"Kiedy faceci widz\u0105 helikopter","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1792298_4.jpg","mposter_url":""},{"mid":"1792283","id":"1792283","length":"199","title":"Drugie \u017cycie ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1792283_2.jpg","mposter_url":""},{"mid":"1791299","id":"1791299","length":"39","title":"Podsiad\u0142o i depresja \u015bwi\u0105teczna","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1791299_2.jpg","mposter_url":""},{"mid":"1790777","id":"1790777","length":"57","title":"Kiedy z ziomeczkami..","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1790777_2.jpg","mposter_url":""},{"mid":"1790760","id":"1790760","length":"90","title":"GTA live ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1790760_6.jpg","mposter_url":""},{"mid":"1719241","id":"1719241","length":"16","title":" ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1719241_1.jpg","mposter_url":""},{"mid":"1719237","id":"1719237","length":"13","title":"Halloween ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1719237_4.jpg","mposter_url":""},{"mid":"1719235","id":"1719235","length":"24","title":"PGA Pozna\u0144","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1719235_6.jpg","mposter_url":""},{"mid":"1719215","id":"1719215","length":"56","title":"Introwertycy","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1719215_3.jpg","mposter_url":""},{"mid":"1719214","id":"1719214","length":"12","title":"Nied\u017awied\u017a ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1719214_2.jpg","mposter_url":""},{"mid":"1714370","id":"1714370","length":"26","title":" ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1714370_5.jpg","mposter_url":""},{"mid":"1714368","id":"1714368","length":"16","title":" ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1714368_6.jpg","mposter_url":""},{"mid":"1714366","id":"1714366","length":"90","title":" ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1714366_3.jpg","mposter_url":""},{"mid":"1714363","id":"1714363","length":"15","title":" ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1714363_1.jpg","mposter_url":""},{"mid":"1714362","id":"1714362","length":"7","title":" ","poster_url":"https://cdnt.onnetwork.tv/poster/1/7/1714362_1.jpg","mposter_url":""},{"mid":"1664619","id":"1664619","length":"65","title":"South Park w wersji AI","poster_url":"https://cdnt.onnetwork.tv/poster/1/6/1664619_1.jpg","mposter_url":""},{"mid":"1662862","id":"1662862","length":"11","title":"Dozownik z go\u0142\u0119bia","poster_url":"https://cdnt.onnetwork.tv/poster/1/6/1662862_6.jpg","mposter_url":""},{"mid":"1661681","id":"1661681","length":"18","title":"Ma\u0142a rzecz a cieszy","poster_url":"https://cdnt.onnetwork.tv/poster/1/6/1661681_5.jpg","mposter_url":""},{"mid":"1661643","id":"1661643","length":"90","title":"Redneck Wizard","poster_url":"https://cdnt.onnetwork.tv/poster/1/6/1661643_3.jpg","mposter_url":""}],"frid":1792304,"widgetId":1639,"devicetype":"desktop","firstmidvideo":"MTc5MjMwNCw5eDE2LDAsMiw0OTUxLDE2NTI4LDAsMCwyLDIsMCwwLDAsMCwzLDEsMCwwLDIsMCwwLDAsMCwwLDAsMCwwLDA7MDstMTstMTtUTDswOzA7MDs1NiwwLDAsMCwwLDAsMDswOzA7MDswOzA7MCwx","defsd":{"playlist":"4951","reelType":"0","reelRows":"2","reelColumns":"2","reelHeight":"280px","reelClosureButton":"25","reelListBackgroundColor":"rgba(0, 0, 0, 1)","reelListBackgroundImage":"","reelBackgroundColor":"rgba(255, 255, 255, 0.96)","reelBackgroundImage":"","reelBackgroundImageCustomCss":"","reelPosition":"2","reelMax":"30","reelMargin":"","reelBorder":"","reelBorderRad":"","reelMarginList":"10px","reelPadding":"","reelBorderList":"4px solid white","reelBorderRadList":"12px","reelTitlePosition":"1","reelTitleCustomCss":"display: flex; justify-content:center; align-items:center","reelPaddingList":"0px","reelTitleColor":"rgba(254, 254, 254, 1)","reelTitleFont":"","reelTitleFontSize":"1","reelTitleHeight":"1%","reelTimerPosition":"3","reelTimerCustomCss":"border-radius:4px","reelTimerColor":"rgba(255, 255, 255, 1)","reelTimerBackground":"rgba(0,0,0,1)","reelTimerFont":"","reelTimerFontSize":"10","reelTimerMargin":"4px","reelTimerPadding":"1px 4px","reelTitleMargin":"","reelTitlePadding":"6%","reelTitleBackground":"rgba(13,12,12,0.8)","reelBehaviourMPosterUse":"0","reelBehaviourMPosterVisibilityThreshold":"80","reelBehaviourChangeThreshold":"3","reelBehaviourMPosterMode":"1","reelBehaviourWidgetScrollMode":"2","reelBehaviourWidgetIdleScrollBy":"100","reelBehaviourWidgetIdleInterval":"2000","reelTouchScrollAxis":"Y","reelBehaviourShowFirstReelMode":"3","reelNoNextPosterSwipe":"0","ads_emission_selectr":"0","widgets_emission_preroll_select_first_ad":"1","widgets_emission_preroll_list":"","widgets_emission_preroll_select_another_ad":"2","widgets_emission_midroll_select_first_ad":"1","widgets_emission_midroll_list":"","widgets_emission_midroll_select_another_ad":"1","widgets_emission_periodic_first_ad_number":"1","widgets_emission_periodic_first_ad_seconds":"","widgets_emission_periodic_next_ads_number_interval":"1","widgets_emission_periodic_next_ads_seconds_interval":"","reelListPlayButtonURL":"","reelListPlayButtonCustomCss":"","reelListPlayButtonSvgShow":"1","reelListPlayButtonSvgWidth":"40","reelListPlayButtonSvgTop":"50","reelListPlayButtonSvgLeft":"50","reelListPlayButtonSvgFill":"rgba(255,255,255,0)","reelListPlayButtonSvgWcpCircleStroke":"rgba(255,255,255,0.8)","reelListPlayButtonSvgWcpTriangleFill":"rgba(255,255,255,0.8)"},"classToAdd":"carousel","addcss":"","isProduction":true,"debugReelsWidget":false} ; var isMobile = 0; var nstylet = (isMobile ? 'body.ONNovhByReel { overflow: hidden !important; position: fixed !important;}' : '') + ' div.totalcontainerexs{ position:relative;display:flex;flex-direction:column;justify-content:center;width:100%;margin:0px;height:auto;box-sizing:border-box;align-items:stretch; background-color:transparent;}' + ' div.playercontainerexs{ width:100%;height:100%;position:fixed;top:0;left:0;z-index:1000;display:none; }' + ' #playerPreviewContainer div.playercontainerexs, #totalcontainerdesktop'+uid+' div.playercontainerexs{ position:absolute;top:0;left:0;z-index:1000;display:none; }' + ' #totalcontainerdesktop'+uid+' { height: 100%; }' + ' div.widgetcontainerexs{ width:100%;height:auto;display:block; }' + ' div.widgetcontainerexs>div{ position:relative;display:block;width:100%;height:100%;left:0px;top:0px;border:none;margin:0px;padding:0px;overflow:hidden;}' + ' div.widgetcontainerexs>div>div{ position:absolute;display:block;width:100%;height:100%;left:0px;top:0px;border:none;margin:0px;padding:0px;overflow:hidden; }' + ' .playercontainerexs > div > div, .playercontainerexs > div > div > iframe { box-sizing: border-box !important; }' + ' .reelPosition0 > .playercontainerexs > div { width:100% !important;height:100% !important;min-width:100% !important;min-height:100% !important;'+ ' max-width:100% !important;max-height:100% !important;padding:0 !important;margin:0 !important; }'+ ' .reelPosition0 > .playercontainerexs > div > div { width:100% !important;height:100% !important;min-width:100% !important;min-height:100% !important;'+ ' max-width:100% !important;max-height:100% !important; }'+ ' .reelPosition0 > .playercontainerexs > div > div > iframe { width:100% !important;height:100% !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important;padding:0 !important;margin:0 !important; }' + ' .reelPosition1 > .playercontainerexs { flex-direction: column; justify-content: flex-start; align-items: stretch; }' + ' .reelPosition1 > .playercontainerexs > div { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important;padding:0 !important;margin:0 !important; }'+ ' .reelPosition1 > .playercontainerexs > div > div { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important; }'+ ' .reelPosition1 > .playercontainerexs > div > div > iframe { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important;padding:0 !important;margin:0 !important; }' + ' .reelPosition2 > .playercontainerexs { flex-direction: column; justify-content: center; align-items: stretch; }' + ' .reelPosition2 > .playercontainerexs > div { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important;padding:0 !important;margin:0 !important; }'+ ' .reelPosition2 > .playercontainerexs > div > div { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important; }'+ ' .reelPosition2 > .playercontainerexs > div > div > iframe { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important;padding:0 !important;margin:0 !important; }' + ' .reelPosition3 > .playercontainerexs { flex-direction: column; justify-content: flex-end; align-items: stretch; }' + ' .reelPosition3 > .playercontainerexs > div { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important;padding:0 !important;margin:0 !important; }'+ ' .reelPosition3 > .playercontainerexs > div > div { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important; }'+ ' .reelPosition3 > .playercontainerexs > div > div > iframe { width:100% !important;height:auto !important;min-width:100% !important;min-height:auto !important;'+ ' max-width:100% !important;max-height:100% !important;padding:0 !important;margin:0 !important; }' ; var nefrag = '
' + ' ' ; var ONNScrollFixedPos = 0; function ONNdisableFixedScroll() { if (!isMobile) { return; } if (document.body.classList.contains("ONNovhByReel")) { return; } ONNScrollFixedPos = window.pageYOffset; document.body.style.top = "-" + ONNScrollFixedPos + "px"; document.body.classList.add("ONNovhByReel"); } function ONNenableFixedScroll() { if (!isMobile) { return; } document.body.style.top = ""; document.body.classList.remove("ONNovhByReel"); window.scrollTo({ top: ONNScrollFixedPos, behavior: "instant" }); } var widgetPlayer = null; function insertWidget( container , ib ){ var nstyle = document.createElement( "style" ); nstyle.innerHTML = nstylet ; nstyle.dataset['cfasync']="false"; var tcontainer = document.createElement( "div" ); tcontainer.innerHTML = nefrag ; tcontainer.className = "totalcontainerexs widshorts wid1639 reelPosition2" ; tcontainer.dataset['cfasync']="false"; if (!isMobile) { tcontainer.id = "totalcontainerdesktop"+uid; } document.body.appendChild( nstyle ); if (ib){ container.parentElement.insertBefore( tcontainer , document.currentScript ); } else{ container.appendChild( tcontainer ); } var wmc=document.getElementById('ld'+uid); if(wmc){ import( "https://cdn.onnetwork.tv/js/widgets/widgetShortslist.js?s="+Date.now() ).then(({WidgetPlayer})=>{ wConfig['uid'] = uid; wConfig['iid'] = iid ; wConfig['cId'] = 'ld'+uid ; if(wConfig.defsd.reelBehaviourShowFirstReelMode==1){ console.log("opacity"); wmc.style.opacity='0'; } playerCont = document.getElementById('p'+uid); widgetPlayer = new WidgetPlayer(wConfig, wmc, playerCont); }); } } window.addEventListener("message",(e)=>{ try{ if (!e.data.indexOf || (e.data.indexOf("onntv://")!=0)){ return ; } var com = {} ; try{ com = JSON.parse( e.data.substr( 8 ) ); }catch(e){ com = {} ; } switch (com.comm){ // TOCHECK - Wydaje mi się, że punktu widzenia zależności widget-player komunikacja jest taka jak powinna być, // ale na pewno nie jest najszybsza jakaby mogła być, bo wysyła komendy asynchronicznie. Teraz wygląda to tak: // Swiped in player -> postMessage -> receive here in nextReel/prevReel -> call widgetPlayer playNextMovie/playPrevMovie -> // -> change inner properties, related to current playing reel position in playlist -> send startShort command -> send startmovie message to player and play another vid case "moviecompleted" : if (parseInt(com.iid) != iid){ break ; } case "nextReel": if (parseInt(com.iid) == iid){ if (widgetPlayer != null && typeof widgetPlayer.playNextMovie == "function") { widgetPlayer.playNextMovie(); } } break; case "prevReel": if (parseInt(com.iid) == iid){ if (widgetPlayer != null && typeof widgetPlayer.playPrevMovie == "function") { widgetPlayer.playPrevMovie(); } } break; case "playerLoaded" : if (parseInt(com.iid) == iid){ playerLoaded = true ; if(wConfig.defsd.reelBehaviourShowFirstReelMode==1){ console.log( "revopacity" ); wmc=document.getElementById('ld'+uid); if(wmc){wmc.style.opacity='';} } if(reelToStart>0){ var pc = document.getElementById( "pid"+com.iid ); if(pc){ pc.style.display = "flex" ; window.ONTVsendCommand("startmovie",parseInt(com.iid),parseInt(reelToStart)); } ONNdisableFixedScroll(); reelToStart = 0 ; } } break ; case "startShort": if(parseInt(com.iid)==iid){ if(!playerLoaded){ reelToStart = com.subject ; break ; } var pc = document.getElementById( "pid"+com.iid ); if(pc){ pc.style.display = "flex" ; window.ONTVsendCommand("startmovie",parseInt(com.iid),parseInt(com.subject)); } ONNdisableFixedScroll(); } break ; case "startnextshort" : if(parseInt(com.iid)==iid){ var pc = document.getElementById( "pid"+com.iid ); if (pc && widgetPlayer != null && typeof widgetPlayer.playNextMovie == "function") { pc.style.display = "flex" ; widgetPlayer.playNextMovie(); widgetPlayer.signalReelOpen(0); } } break ; case "closeShorts": if(parseInt(com.iid)==iid){ var pc = document.getElementById( "pid"+com.iid ); if(pc){ window.ONTVsendCommand("pause",parseInt(com.iid)); pc.style.display = "none" ; } ONNenableFixedScroll(); } break ; case "widgetloaded": if(parseInt(com.iid)==iid){ var pscript = document.createElement( "script" ); pscript.src = _ONND_URL_EMBED + '/embed.php?mid='+com.subject+'&iid='+iid+'&cId=p'+uid+'&widget='+widget+vids+overwrites ; pscript.async = true ; document.body.appendChild( pscript ); } break ; } }catch(e){} },false); if ((cId!="") && document.getElementById( cId )){ insertWidget( document.getElementById( cId ) , false ); }else if (document.currentScript && document.currentScript.parentElement){ insertWidget( document.currentScript , true ); } })(1639,"","");