From 3360a1c7857ee9f3600aaee837fe4015f9f2f719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20Wersd=C3=B6rfer?= Date: Sun, 10 Nov 2024 14:17:43 +0100 Subject: [PATCH] #167 podlove player style fix player overlapping text --- cast/static/cast/vite/manifest.json | 2 +- ...{podlovePlayer-Cn4SwLmX.js => podlovePlayer-B4XsqMbN.js} | 6 +++--- javascript/src/audio/podlove-player.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename cast/static/cast/vite/{podlovePlayer-Cn4SwLmX.js => podlovePlayer-B4XsqMbN.js} (77%) diff --git a/cast/static/cast/vite/manifest.json b/cast/static/cast/vite/manifest.json index ec2f188c..6f9348bd 100644 --- a/cast/static/cast/vite/manifest.json +++ b/cast/static/cast/vite/manifest.json @@ -1,6 +1,6 @@ { "src/audio/podlove-player.ts": { - "file": "podlovePlayer-Cn4SwLmX.js", + "file": "podlovePlayer-B4XsqMbN.js", "name": "podlovePlayer", "src": "src/audio/podlove-player.ts", "isEntry": true diff --git a/cast/static/cast/vite/podlovePlayer-Cn4SwLmX.js b/cast/static/cast/vite/podlovePlayer-B4XsqMbN.js similarity index 77% rename from cast/static/cast/vite/podlovePlayer-Cn4SwLmX.js rename to cast/static/cast/vite/podlovePlayer-B4XsqMbN.js index b0a187f6..6b606cdb 100644 --- a/cast/static/cast/vite/podlovePlayer-Cn4SwLmX.js +++ b/cast/static/cast/vite/podlovePlayer-B4XsqMbN.js @@ -2,13 +2,13 @@ class d extends HTMLElement{constructor(){super(),this.observer=null,this.shadow .podlove-player-container { width: 100%; max-width: 936px; - height: 300px; + min-height: 300px; margin: 0 auto; } @media (max-width: 768px) { .podlove-player-container { max-width: 366px; - height: 500px; + min-height: 500px; } } .podlove-player-container iframe { @@ -16,4 +16,4 @@ class d extends HTMLElement{constructor(){super(),this.observer=null,this.shadow height: 100%; border: none; } - `,this.shadow.appendChild(t),this.shadow.appendChild(e)}observeElement(){this.observer=new IntersectionObserver((e,t)=>{e.forEach(i=>{i.isIntersecting&&(this.initializePlayer(),t.unobserve(this))})}),this.observer.observe(this)}initializePlayer(){const e=this.shadow.querySelector(".podlove-player-container"),t=this.getAttribute("id")||`podlove-player-${Date.now()}`,i=this.getAttribute("data-url"),n=this.getAttribute("data-config")||"/api/audios/player_config/",l=this.getAttribute("data-template");let a=this.getAttribute("data-embed")||"https://cdn.podlove.org/web-player/5.x/embed.js";const{protocol:h,hostname:r,port:s}=window.location;console.log("data template: ",l);const o=document.createElement("div");o.id=t,l!==null&&o.setAttribute("data-template",l),e.appendChild(o),typeof podlovePlayer=="function"?podlovePlayer(o,i,n):(r==="localhost"&&a.startsWith("/")&&(a=`http://localhost:${s}${a}`),import(a).then(()=>{podlovePlayer(o,i,n)}))}}console.log("Registering podlove-player!");customElements.define("podlove-player",d); + `,this.shadow.appendChild(t),this.shadow.appendChild(e)}observeElement(){this.observer=new IntersectionObserver((e,t)=>{e.forEach(i=>{i.isIntersecting&&(this.initializePlayer(),t.unobserve(this))})}),this.observer.observe(this)}initializePlayer(){const e=this.shadow.querySelector(".podlove-player-container"),t=this.getAttribute("id")||`podlove-player-${Date.now()}`,i=this.getAttribute("data-url"),l=this.getAttribute("data-config")||"/api/audios/player_config/",a=this.getAttribute("data-template");let n=this.getAttribute("data-embed")||"https://cdn.podlove.org/web-player/5.x/embed.js";const{protocol:h,hostname:r,port:s}=window.location;console.log("data template: ",a);const o=document.createElement("div");o.id=t,a!==null&&o.setAttribute("data-template",a),e.appendChild(o),typeof podlovePlayer=="function"?podlovePlayer(o,i,l):(r==="localhost"&&n.startsWith("/")&&(n=`http://localhost:${s}${n}`),import(n).then(()=>{podlovePlayer(o,i,l)}))}}console.log("Registering podlove-player!");customElements.define("podlove-player",d); diff --git a/javascript/src/audio/podlove-player.ts b/javascript/src/audio/podlove-player.ts index 901e1bd9..1eedcaff 100644 --- a/javascript/src/audio/podlove-player.ts +++ b/javascript/src/audio/podlove-player.ts @@ -37,13 +37,13 @@ class PodlovePlayerElement extends HTMLElement { .podlove-player-container { width: 100%; max-width: 936px; - height: 300px; + min-height: 300px; margin: 0 auto; } @media (max-width: 768px) { .podlove-player-container { max-width: 366px; - height: 500px; + min-height: 500px; } } .podlove-player-container iframe {