(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 ) + "1701" ; var uid="id"+iid; var playerLoaded = false ; var reelToStart = 0 ; var wConfig = {"playlistitems":[{"mid":"1293089","id":"1293089","length":"57","title":"Highlander & Cola RTD - jak smakuje? Testujemy gotowe drinki w puszkach! #m\u00f3jbar #rtd #highlander","adddatesec":"1693424924","poster_url":"https://cdnt.onnetwork.tv/poster/1/2/1293089_1.jpg","mposter_url":""},{"mid":"1298336","id":"1298336","length":"59","title":"Gordons Gin & Tonic RTD - jak smakuje? Testujemy gotowe drinki w puszkach! #m\u00f3jbar #rtd #drinki","adddatesec":"1694031914","poster_url":"https://cdnt.onnetwork.tv/poster/1/2/1298336_1.jpg","mposter_url":""},{"mid":"1339178","id":"1339178","length":"60","title":"DEATH & TAXES #cocktailstory o podatkach i konkurencji #m\u00f3jbar #drinki #podatki #deathandtaxes","adddatesec":"1697652455","poster_url":"https://cdnt.onnetwork.tv/poster/1/3/1339178_1.jpg","mposter_url":""},{"mid":"1382457","id":"1382457","length":"60","title":"FISH HOUSE PUNCH i #cocktailstory o akcji ratunkowej SS Politician #m\u00f3jbar #drinki #fishhousepunch","adddatesec":"1701466086","poster_url":"https://cdnt.onnetwork.tv/poster/1/3/1382457_1.jpg","mposter_url":""},{"mid":"1454260","id":"1454260","length":"8","title":"TWISTERS | TikTok pl","adddatesec":"1707948238","poster_url":"https://cdnt.onnetwork.tv/poster/1/4/1454260_1.jpg","mposter_url":""},{"mid":"1481958","id":"1481958","length":"48","title":"Kto wyla\u0142 w\u00f3dk\u0119? #cocktailstory | Przepis na POLISH MARTINI z mojbar.pl #drinki","adddatesec":"1710365323","poster_url":"https://cdnt.onnetwork.tv/poster/1/4/1481958_1.jpg","mposter_url":""},{"mid":"1500202","id":"1500202","length":"50","title":"MANHATTAN - #koktajlowaklasyka cz. 1 - wi\u0119cej ni\u017c koktajl z wisienk\u0105 #mojbar #drinki #manhattan","adddatesec":"1711753689","poster_url":"https://cdnt.onnetwork.tv/poster/1/5/1500202_1.jpg","mposter_url":""},{"mid":"1552981","id":"1552981","length":"43","title":"Czy Polacy wymy\u015blili szablowanie szampana?! #cocktailstory | Przepis na #kirimperial","adddatesec":"1715803452","poster_url":"https://cdnt.onnetwork.tv/poster/1/5/1552981_1.jpg","mposter_url":""},{"mid":"1802718","id":"1802718","length":"57","title":"Czy Polacy stworzyli ameryka\u0144sk\u0105 whiskey? | Przepis na #OldPal | #cocktailstory","adddatesec":"1736176984","poster_url":"https://cdnt.onnetwork.tv/poster/1/8/1802718_1.jpg","mposter_url":""},{"mid":"2053564","id":"2053564","length":"60","title":"Pierwszy raz przed mikrofonem radiowej Dw\u00f3jki #radio","adddatesec":"1758996141","poster_url":"https://cdnt.onnetwork.tv/poster/2/0/2053564_1.jpg","mposter_url":""}],"frid":940495,"widgetId":1701,"devicetype":"desktop","isIos":0,"firstmidvideo":"OTQwNDk1LDl4MTYsMCw1MCw0NjI2LDE2ODg4LDEsMCwxLDUwLDAsMCwwLDAsMSwxLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwOzA7LTE7LTE7VEw7MDswOzA7NTYsMCwwLDAsMCwwLDA7MDswOzA7MDswOzAsMA==","defsd":{"playlist":"4626","reelType":"1","reelRows":"2","reelColumns":"4","reelHeight":"300px","reelClosureButton":"91","reelListBackgroundColor":"rgba(255, 255, 255, 0)","reelListBackgroundImage":"","reelBackgroundColor":"rgba(255, 255, 255, 0.84)","reelBackgroundImage":"","reelBackgroundImageCustomCss":"","reelPosition":"0","reelMax":"10","reelMargin":"1px","reelBorder":"1px solid #000","reelBorderRad":"15px","reelMarginList":"2px","reelPadding":"1px","reelBorderList":"0px","reelBorderRadList":"12px","reelTitlePosition":"0","reelTitleCustomCss":"display: flex; justify-content:center; align-items:center","reelPaddingList":"2px","reelTitleColor":"rgba(255, 255, 255, 1)","reelTitleFont":"","reelTitleFontSize":"10","reelTitleHeight":"20%","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":"4px 0","reelTitlePadding":"6%","reelTitleBackground":"rgba(13,12,12,0.8)","reelBehaviourMPosterUse":"0","reelBehaviourMPosterVisibilityThreshold":"80","reelBehaviourChangeThreshold":"50","reelBehaviourMPosterMode":"1","reelBehaviourWidgetScrollMode":"0","reelBehaviourWidgetIdleScrollBy":"100","reelBehaviourWidgetIdleInterval":"2000","reelTouchScrollAxis":"X","reelBehaviourShowFirstReelMode":"0","reelNoNextPosterSwipe":"0","reelListPlayButtonURL":"","reelListPlayButtonCustomCss":""},"classToAdd":"grid","addcss":"","isProduction":true,"debugReelsWidget":false} ; var isMobile = 0; var useNewDesktop = 0; var desktopStylingCss = ``; var desktopStylingJs = ``; var widgetClass = 'wid' + widget ; if (!useNewDesktop) { var nstylet = (isMobile ? 'body.ONNovhByReel { overflow: hidden !important; position: fixed !important;}' : '') + ' div.totalcontainerexs.'+widgetClass+'{ 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.'+widgetClass+'{ width:100%;height:100%;position:fixed;top:0;left:0;z-index:2147483647;display:none; }' + ' #playerPreviewContainer div.playercontainerexs.'+widgetClass+', #totalcontainerdesktop'+uid+' div.playercontainerexs.'+widgetClass+'{ position:absolute;top:0;left:0;z-index:2147483647;display:none; }' + ' #totalcontainerdesktop'+uid+' { height: 100%; }' + ' div.widgetcontainerexs.'+widgetClass+'{ width:100%;height:auto;display:block; }' + ' div.widgetcontainerexs.'+widgetClass+'>div{ position:relative;display:block;width:100%;height:100%;left:0px;top:0px;border:none;margin:0px;padding:0px;overflow:hidden;}' + ' div.widgetcontainerexs.'+widgetClass+'>div>div{ position:absolute;display:block;width:100%;height:100%;left:0px;top:0px;border:none;margin:0px;padding:0px;overflow:hidden; }' + ' .playercontainerexs.'+widgetClass+' > div > div, .playercontainerexs.'+widgetClass+' > div > div > iframe { box-sizing: border-box !important; }' + ' .reelPosition0 > .playercontainerexs.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' { flex-direction: column; justify-content: flex-start; align-items: stretch; }' + ' .reelPosition1 > .playercontainerexs.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' { flex-direction: column; justify-content: center; align-items: stretch; }' + ' .reelPosition2 > .playercontainerexs.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' { flex-direction: column; justify-content: flex-end; align-items: stretch; }' + ' .reelPosition3 > .playercontainerexs.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' > 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 = '
' + '
' + '
' + '
' ; } else { var nstylet = (isMobile ? 'body.ONNovhByReel { overflow: hidden !important; position: fixed !important;}' : '') + ' div.totalcontainerexs.'+widgetClass+'{ 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;}' + ' #playerPreviewContainer div.playercontainerexs.'+widgetClass+'{ position:absolute;top:0;left:0;z-index:2147483647;display:none; }' + ' div.widgetcontainerexs.'+widgetClass+'{ width:100%;height:auto;display:block; }' + ' div.widgetcontainerexs.'+widgetClass+'>div{ position:relative;display:block;width:100%;height:100%;left:0px;top:0px;border:none;margin:0px;padding:0px;overflow:hidden;}' + ' div.widgetcontainerexs.'+widgetClass+'>div>div{ position:absolute;display:block;width:100%;height:100%;left:0px;top:0px;border:none;margin:0px;padding:0px;overflow:hidden; }' + ' .playercontainerexs.'+widgetClass+' > div > div, .playercontainerexs.'+widgetClass+' > div > div > iframe { box-sizing: border-box !important; }' + ' .reelPosition0 > .playercontainerexs.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' { flex-direction: column; justify-content: flex-start; align-items: stretch; }' + ' .reelPosition1 > .playercontainerexs.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' { flex-direction: column; justify-content: center; align-items: stretch; }' + ' .reelPosition2 > .playercontainerexs.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' { flex-direction: column; justify-content: flex-end; align-items: stretch; }' + ' .reelPosition3 > .playercontainerexs.'+widgetClass+' > 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.'+widgetClass+' > 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.'+widgetClass+' > 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 = '
' + '
' + '
' ; if (isMobile) { nstylet += ' div.playercontainerexs.'+widgetClass+'{ width:100%;height:100%;position:fixed;top:0;left:0;z-index:2147483647;display:none; }'; nefrag = '
' + nefrag; } else { nstylet += ' div.playercontainerexswrapper{ width:auto;height:100%;position:fixed;top:0;left:0;z-index:2147483646;display:none;}' + ' div.playercontainerexs.'+widgetClass+'{ z-index:2147483647;display:none; aspect-ratio: 9/16; }'; nefrag = '
' + '
' + '
' + '
' + '
' + '
' + '
' + 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 ; if (useNewDesktop) { tcontainer.className = "totalcontainerexs widshorts wid1701 reelPosition0 " + (isMobile ? "mobile" : "desktop") ; } else { tcontainer.className = "totalcontainerexs widshorts wid1701 reelPosition0" ; } tcontainer.dataset['cfasync']="false"; if (!isMobile && !useNewDesktop) { 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); if (desktopStylingCss != "") { try { const std = document.createElement("style"); std.type="text/css" ; std.innerHTML = desktopStylingCss; std.id = "ONNdesktopStylingCssWidget"+iid; document.body.appendChild(std); } catch(dsce){ console.log(dsce); } } if (desktopStylingJs != "") { try{Function('"use strict";'+desktopStylingJs+';')();}catch(dsje){ console.log(dsje); } } if (useNewDesktop) { try{ document.querySelector(".onnwrapperbuttons-prev")?.addEventListener("click", () => { widgetPlayer.playPrevMovie(); }); }catch(e){} try{ document.querySelector(".onnwrapperbuttons-next")?.addEventListener("click", () => { widgetPlayer.playNextMovie(); }); }catch(e){} } }); } } 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" ; if (!isMobile && useNewDesktop) { try { var pcw = document.querySelector( ".playercontainerexswrapper" ); pcw.style.display = "flex" ; } catch(ew){} } 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" ; if (!isMobile && useNewDesktop) { try { var pcw = document.querySelector( ".playercontainerexswrapper" ); pcw.style.display = "flex" ; } catch(ew){} } 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" ; if (!isMobile && useNewDesktop) { try { var pcw = document.querySelector( ".playercontainerexswrapper" ); pcw.style.display = "flex" ; } catch(ew){} } 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" ; if (!isMobile && useNewDesktop) { try { var pcw = document.querySelector( ".playercontainerexswrapper" ); pcw.style.display = "none" ; } catch(ew){} } } 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 ); } })(1701,"","");