1import{_ as x,af as c,V as v,Z as k,W as w,B as d,Q as u,E as P,as as E}from"./Il4zDAxP.js";import{b as n,k as S,f as h,x as A,g as s,p,u as m,v as C,e as a,d as g,t as f,A as V}from"./DlIyoXyK.js";import{a as z}from"./C_ynCuYc.js";import"./D1cJsHFp.js";import"./CoVgqjFf.js";const B={props:{channel:{type:Object,default:null},recording:{type:Boolean,default:!1}},data(){return{setupDone:!1,streamError:!1,playing:!1}},computed:{checkoutPagesActive(){return P().fullPath.includes("/checkout")},isPortrait(){return!this.recording&&!!this.channel?.is_mobile_live},startSeconds(){return this.recording?Math.max(0,Number.parseInt(this.channel?.recording_start_seconds)||0):0}},mounted(){if(!this.channel||!this.channel.playbackUrl||!this.recording&&!this.channel.is_started){this.streamError=!0;return}this.$nextTick(()=>{this.startStream()})},beforeUnmount(){this.stream?.destroy(),this.stream=null},methods:{async startStream(){const t=this.$refs.teaserVideo;if(!t){this.streamError=!0;return}this.bindVideoEvents();const e=await z(t,this.channel.playbackUrl,{preset:"teaser",live:!this.recording,provider:this.channel.defaultProvider??null,startPosition:this.startSeconds>0?this.startSeconds:-1,onFatal:()=>{this.streamError=!0}});if(this.$.isUnmounted){e.destroy();return}this.stream=e,e.ready.then(()=>{this.setupDone=!0,this.startMutedPlayback()}).catch(()=>{})},bindVideoEvents(){const t=this.$refs.teaserVideo;t&&(t.addEventListener("playing",()=>{this.streamError=!1,this.playing=!0}),t.addEventListener("ended",()=>{if(!this.recording){this.streamError=!0;return}const e=t.duration&&this.startSeconds>=t.duration?0:this.startSeconds;t.currentTime=e,t.play()?.catch?.(()=>{})}))},startMutedPlayback(){const t=this.$refs.teaserVideo;t&&(t.volume=0,t.muted=!0,t.play()?.catch?.(()=>{}))},trackClick(){if(this.recording){u("recording_teaser_player_click",{what:this.channel.name});return}u("teaser_player_click")},disable(){if(this.recording){d().dismissHighlightedRecording();return}d().disableTeaserPlayer()}}},T={class:"group"},D=["width","height"],I={class:"mx-auto -mt-5 w-12 rounded-full border-[3px] border-white bg-black/20 p-3"},L={key:0,class:"absolute inset-x-0 bottom-0 bg-[#05070d] py-1 text-xs text-white md:text-sm"},U={class:"flex items-center justify-center gap-1.5"},M={class:"tracking-wide uppercase"},N={key:1,class:"absolute inset-x-0 bottom-0 bg-red-600 py-1 text-xs text-white md:text-sm"},j={class:"flex items-center justify-center"},O={class:"absolute top-2 right-2 z-20 rounded bg-black/40 px-2 py-1.5 md:top-3 md:right-3 lg:opacity-0 lg:transition-opacity lg:duration-500 lg:group-hover:opacity-100"};function R(t,e,o,Z,i,r){const _=k,y=v,l=w,b=E;return n(),S(b,null,{default:h(()=>[A(s("div",{class:p({"fixed right-3 z-20 cursor-pointer overflow-hidden shadow-2xl transition-all duration-[2s]":!0,"w-[50%] max-w-[280px] rounded-lg bg-white":!r.isPortrait,"w-[40%] max-w-[160px] rounded-2xl bg-zinc-950 lg:max-w-[200px]":r.isPortrait,"bottom-20":("isApp"in t?t.isApp:m(c))(),"bottom-3":!("isApp"in t?t.isApp:m(c))(),"translate-x-[300px] opacity-0":!i.playing,"translate-x-0 opacity-100":i.playing})},[s("div",T,[s("video",{ref:"teaserVideo",disablePictureInPicture:"",class:p(["max-h-[90vh] w-full bg-black",r.isPortrait?"aspect-[9/16]":"aspect-[16/9]"]),width:r.isPortrait?720:1920,height:r.isPortrait?1280:1080,playsinline:"",onContextmenu:e[0]||(e[0]=C(()=>{},["prevent"]))},null,42,D),e[2]||(e[2]=s("div",{class:"absolute inset-0 opacity-50 backdrop-blur"},null,-1)),a(y,{to:`/live/${o.channel.name}`,class:"absolute inset-0 z-10 flex cursor-pointer items-center text-center align-middle",onClick:r.trackClick},{default:h(()=>[s("div",I,[a(_,{alt:"",class:"w-full",src:"/img/icons/play-white.svg"})])]),_:1},8,["to","onClick"]),o.recording?(n(),g("div",L,[s("div",U,[a(l,{name:"heroicons:play-solid",class:"text-gold size-3 shrink-0"}),s("span",M,f(t.$t("Aufzeichnung ansehen")),1)])])):(n(),g("div",N,[s("div",j,[e[1]||(e[1]=s("span",{class:"mr-2 size-1 shrink-0 animate-ping rounded-full bg-white"},null,-1)),s("span",null,f(t.$t("JETZT LIVE")),1)])])),s("div",O,[a(l,{name:"heroicons:x-mark-solid",class:"w-5 cursor-pointer text-white",onClick:r.disable},null,8,["onClick"])])])],2),[[V,i.setupDone&&!i.streamError&&!r.checkoutPagesActive]])]),_:1})}const $=x(B,[["render",R]]);
1export{$ as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.