@vime/core
Version:
Customizable, extensible, accessible and framework agnostic media player.
1 lines • 799 B
JavaScript
import{g as n,w as o}from"./p-aa8acb66.js";import{j as t,x as s,r as a,y as c}from"./p-b018976f.js";const e=new Set,r=new Set,p=new Map;function i(){o((()=>{r.forEach((n=>{const o=parseFloat(window.getComputedStyle(n).height);e.forEach((t=>{const s=p.get(t),a=c(t,n),e=c(t,n,0,o)||c(t,n,0,-o);s.set(n,a||e?o:0)}))})),e.forEach((n=>{const o=p.get(n);n.style.setProperty("--vm-controls-height",`${Math.max(0,Math.max(...o.values()))}px`)}))}))}function w(o){const c=n(o);function e(){return c.shadowRoot.querySelector(".controls")}t(o,(()=>{const n=e();s(n)||(r.add(n),i())}),(()=>{r.delete(e()),i()})),a(o,"componentDidLoad",(()=>{r.add(e()),i()})),a(o,"componentDidRender",i)}function f(o){const s=n(o);t(o,(()=>{e.add(s),p.set(s,new Map),i()}),(()=>{e.delete(s),p.delete(s)}))}export{w as r,f as w}