Skip to content

Commit

Permalink
#167 podlove player style fix player overlapping text
Browse files Browse the repository at this point in the history
  • Loading branch information
ephes committed Nov 10, 2024
1 parent 81dfd88 commit 3360a1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cast/static/cast/vite/manifest.json
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ 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 {
width: 100%;
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);
4 changes: 2 additions & 2 deletions javascript/src/audio/podlove-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3360a1c

Please sign in to comment.