@asicupv/paella-zoom-plugin
Version:
A plugin to zoom videos for Paella Player
21 lines (20 loc) • 24.2 kB
JavaScript
(function(h,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(h=typeof globalThis<"u"?globalThis:h||self,T(h["paella-zoom-plugin"]={}))})(this,function(h){"use strict";var T=n=>{throw TypeError(n)},U=(n,t,e)=>t.has(n)||T("Cannot "+e),l=(n,t,e)=>(U(n,t,"read from private field"),e?e.call(n):t.get(n)),Z=(n,t,e)=>t.has(n)?T("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),S=(n,t,e,s)=>(U(n,t,"write to private field"),t.set(n,e),e),q=(n,t,e)=>(U(n,t,"access private method"),e);function it(n){n.__hideTimerPaused__=!1}function G(n,{excludedTags:t=null}={}){const e=document.createElement("div");e.innerHTML=n;const s=["script"];return t&&s.push(...t),s.flatMap(i=>Array.from(e.getElementsByTagName(i))).forEach(i=>{i.parentElement.removeChild(i)}),e.innerHTML}var M;let O=class{constructor(t){Z(this,M,null),S(this,M,t)}get player(){return l(this,M)}};M=new WeakMap;function ot({tag:n="div",attributes:t={},children:e="",innerText:s="",parent:i=null}){const o=document.createElement(n);o.innerText=s;for(let c in t)o.setAttribute(c,t[c]);return o.innerHTML=e,i&&i.appendChild(o),o}function I(n,t=null){const e=document.createElement("div");e.innerHTML=n;const s=e.children[0];return t&&t.appendChild(s),s}var g;class at extends O{constructor(t,{tag:e="div",attributes:s=[],children:i="",parent:o=null}){super(t),Z(this,g,null),S(this,g,ot({tag:e,attributes:s,children:i,parent:o})),Object.defineProperty(this,e,{get:()=>l(this,g)})}get element(){return l(this,g)}get parent(){return l(this,g).parentElement}hide(){this.element.style.display="none"}show(t="block"){this.element.style.display=null}get isVisible(){const t=window.getComputedStyle(this.element);return t.display!=="none"&&t.display!==""}setAttribute(t,e){l(this,g).setAttribute(t,e)}removeFromParent(){var t;(t=l(this,g).parentElement)==null||t.removeChild(l(this,g))}setParent(t){this.removeFromParent(),t.appendChild(l(this,g))}}g=new WeakMap;class F extends O{constructor(t,e){super(t),this._name=e}getPluginModuleInstance(){return null}get config(){return this._config}get type(){return"none"}get order(){var t;return((t=this._config)==null?void 0:t.order)||0}get description(){var t;return((t=this._config)==null?void 0:t.description)||""}get name(){return this._name}async isEnabled(){var t;return(t=this.config)==null?void 0:t.enabled}async load(){}async unload(){}}class rt extends O{get moduleName(){return this.player.log.warn(`Incomplete player module definition: '${__filename}.moduleName'`),"-"}get moduleVersion(){return this.player.log.warn(`Incomplete player module definition: '${__filename}.moduleVersion'`),"0.0.0"}async getDictionaries(){return null}}class K extends F{constructor(t,e,s){super(t,e,s),this.__uiPlugin=!0}async getDictionaries(){return null}}const j=()=>{const n=document.createElement("span");return n.classList.add("side-container"),n.classList.add("hidden"),n};class lt{onIconChanged(t,e,s){}onTitleChanged(t,e,s){}onStateChanged(t,e,s,i,o){}}var A,$,w,L,E;class D extends K{constructor(){super(...arguments),Z(this,A),Z(this,w,null),Z(this,L,null),Z(this,E,[])}get type(){return"button"}get container(){return this._container}get button(){return this._button}get interactive(){return!0}get dynamicWidth(){return!1}getId(){return null}get id(){return this.config.id||this.getId()}getButtonName(){return null}get buttonName(){return this.config.name||this.getButtonName()||this.name}get ariaLabel(){return this.config.ariaLabel||this.getAriaLabel()}getAriaLabel(){return""}get tabIndex(){return this.config.tabIndex||this.getTabIndex()}getTabIndex(){return null}getDescription(){return""}get description(){return this.config.description||this.getDescription()}get minContainerSize(){return this.config.minContainerSize||this.getMinContainerSize()}getMinContainerSize(){return 0}setObserver(t){if(t instanceof lt)this._observer=t;else if(typeof t.onIconChanged=="function"||typeof t.onTitleChanged=="function"||typeof t.onStateChanged=="function")this._observer=t;else throw new Error("Invalid observer for ButtonPlugin")}get icon(){return this._icon||(this._icon=""),this._icon}set icon(t){typeof t=="string"&&(t=G(t)),this._icon=t,q(this,A,$).call(this)}get haveIcon(){return this.icon!==""}get menuIcon(){return this._menuIcon||(this._menuIcon=""),this._menuIcon}set menuIcon(t){typeof t=="string"&&(t=G(t)),this._menuIcon=t,q(this,A,$).call(this)}get haveMenuIcon(){return this.menuIcon!==""}get isMenuButton(){var t,e,s;const i=((t=this.config)==null?void 0:t.parentContainer)==="playbackBar"||!((e=this.config)!=null&&e.parentContainer),o=((s=this.config)==null?void 0:s.parentContainer)==="videoContainer";return!i&&!o}get title(){return this._title||""}set title(t){var e;if(this._title=t,t&&this._button instanceof HTMLElement){const s=this._button.querySelector("span")||I(`<span class="button-title-${this.titleSize}"></span>`,this._button);s.innerHTML=t}else if(this._button instanceof HTMLElement){const s=this._button.querySelector("span");s&&this._button.removeChild(s)}(e=this._observer)!=null&&e.onTitleChanged&&this._observer.onTitleChanged(this,this._title,t)}get titleSize(){return"medium"}get side(){var t;return((t=this.config)==null?void 0:t.side)||"left"}get closePopUps(){return this.config.closePopUps||this.getClosePopUps()}getClosePopUps(){return!0}get parentContainer(){var t;return((t=this.config)==null?void 0:t.parentContainer)||"playbackBar"}get className(){return""}enable(){this._enabled=!0,this.show()}disable(){this._enabled=!1,this.hide()}hide(){this._button&&(this._button.style.display="none")}show(){if(this._enabled===!1)return;const{width:t}=this.player.playbackBar.containerSize;this._button&&(t>this.minContainerSize||this.parentContainer!=="playbackBar")&&(this._button.style.display=null)}get leftSideContainer(){return l(this,w)||(S(this,w,j()),this.container.appendChild(l(this,w))),l(this,w)}get leftSideContainerPresent(){return l(this,w)!==null}get rightSideContainer(){return l(this,L)||(S(this,L,j()),this.container.appendChild(l(this,L))),l(this,L)}get rightSideContainerPresent(){return l(this,L)!==null}get stateText(){return null}get stateIcon(){return null}setState({text:t=null,icon:e=null}={}){var s,i;const o=this._statusText,c=this._statusIcon;this._statusText=t,this._statusIcon=e,l(this,E).forEach(r=>r(this)),this._statusIcon&&(this.icon=this._statusIcon,this.menuIcon=this._statusIcon),this._statusText&&(this.title=this._statusText),(i=(s=this._observer)==null?void 0:s.onStateChanged)==null||i.call(s,this,o,t,c,e)}onStateChange(t){typeof t=="function"?l(this,E).push(t):this.player.log.warn("Invalid callback for ButtonPlugin.onStateChange")}async action(t,e=null){}onResize({width:t,height:e}){t<this.minContainerSize?this.hide():this.show()}focus(){var t;(t=this.button)==null||t.focus()}blur(){var t;(t=this.button)==null||t.blur()}isFocus(){return this.button===document.activeElement}}A=new WeakSet,$=function(){var n;const t=this.isMenuButton?this._menuIcon:this._icon,e=this.isMenuButton&&this.haveMenuIcon?this.menuIcon:this.icon;if(e&&this._button instanceof HTMLElement){const s=this._button.querySelector("i")||I("<i></i>",this._button);s.innerHTML=e}else if(this._button instanceof HTMLElement){const s=this._button.querySelector("i");s&&this._button.removeChild(s)}(n=this._observer)!=null&&n.onIconChanged&&this._observer.onIconChanged(this,t,e)},w=new WeakMap,L=new WeakMap,E=new WeakMap;class V extends K{get type(){return"canvasButton"}get content(){return this._config.content||["presenter"]}get ariaLabel(){return this._config.ariaLabel||this.getAriaLabel()}getAriaLabel(){return""}get tabIndex(){return this.config.tabIndex}get description(){return this.config.description||this.getDescription()}getDescription(){return""}get icon(){return this._icon}set icon(t){this._icon=t}get side(){var t;return((t=this.config)==null?void 0:t.side)||"left"}get buttonName(){return this.name}get position(){switch(this.side){case"left":return H.LEFT;case"center":return H.CENTER;case"right":return H.RIGHT;default:throw new Error(`Invalid CanvasButtonPlugin side set: ${this.side}`)}}async action(t){this.player.log.warn(`Action not implemented in canvas button plugin ${this.name}`)}}const H=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right"});class ut extends at{constructor(t,e,s){super(e,{tag:t,parent:s}),this.element.className="video-canvas",this._userArea=null,this._buttonsArea=I(`
<div class="button-area">
<div class="buttons-left"></div>
<div class="buttons-center"></div>
<div class="buttons-right"></div>
</div>
`,this.element)}async loadCanvas(t){throw Error(`${this.name}: loadCanvas() not implemented`)}get userArea(){return this._userArea||(this._userArea=document.createElement("div"),this._userArea.className="user-area",this.element.appendChild(this._userArea)),this._userArea}get leftButtonsArea(){return this._buttonsArea.querySelector(".buttons-left")}get centerButtonsArea(){return this._buttonsArea.querySelector(".buttons-center")}get rightButtonsArea(){return this._buttonsArea.querySelector(".buttons-right")}clearButtonsArea(){this._buttonsArea.childNodes.forEach(t=>{t.innerHTML=""})}showButtons(){this._buttonsArea.style.display=null}hideButtons(){this._buttonsArea.style.display="none"}}class ct extends F{get type(){return"canvas"}get canvasType(){return""}isCompatible(t){return Array.isArray(t==null?void 0:t.canvas)?t.canvas.indexOf(this.canvasType)!==-1:t.canvas===this.canvasType}getCanvasInstance(t){throw Error(`${this.name} canvas plugin: getCanvasInstance() not implemented`)}}class ht extends D{constructor(){super(...arguments),this._refreshContent=!0}set refreshContent(t){this._refreshContent=t}get refreshContent(){return this._refreshContent}get closeParentPopUp(){return this.config.closeParentPopUp||this.getCloseParentPopUp()}getCloseParentPopUp(){return!1}async action(t,e){super.action(t,e),this.parentPopUp=e,await this.showPopUp()}get parentPopUp(){return this._parentPopUp}set parentPopUp(t){this._parentPopUp=t}get popUp(){return this._popUp}get menuTitle(){return this.config.menuTitle||null}get moveable(){return this.config.moveable??!1}get resizeable(){return this.config.resizeable??!1}get customPopUpClass(){return this.config.customPopUpClass??""}get closeActions(){var t,e;const s=((t=this.config.closeActions)==null?void 0:t.clickOutside)??!0,i=((e=this.config.closeActions)==null?void 0:e.closeButton)??!1;return{clickOutside:s,closeButton:i}}get currentContent(){return this._currentContent}async getContent(){return I("<p>Pop Up Button Plugin Content</p>")}async checkRefreshContent(){if(this.refreshContent){const t=await this.getContent();this._currentContent.innerHTML="",Array.from(t.children).forEach(e=>this._currentContent.appendChild(e))}}get popUpType(){return this.config.popUpType||"modal"}hidePopUp(){this.player.playbackBar.popUp.isHidden||this.player.playbackBar.popUp.hide()}async showPopUp(){this._keyEventHandler||(this._keyEventHandler=e=>{e.key==="Escape"&&this.hidePopUp()},this.button.addEventListener("keydown",this._keyEventHandler));const t=this.player.playbackBar.popUp;if(t.isHidden||this._contentId!==t.currentContentId){const e=await this.getContent();this._currentContent=e,this._contentId=t.show({title:this.menuTitle||this.description,content:e,attachRight:this.popUpType==="timeline"||this.side==="right",attachLeft:this.popUpType==="timeline"||this.side==="left",parent:this.parentPopUp})}else t.hide()}}const dt=n=>n?`<span class="menu-title">${n}</span>`:"",mt=n=>n?`<i class="menu-icon">${n}</i>`:"",pt=n=>n?`aria-label="${n}"`:"",gt=n=>n?`<span class="state-text">${n}</span>`:"",ft=n=>n?`<i class="state-icon">${n}</i>`:"",vt=(n,t)=>n||t?`<span class="button-state">${gt(n)}${ft(t)}</span>`:"";function yt({itemData:n,buttonType:t,container:e,allItems:s,menuName:i,selectedItems:o,itemPlugin:c}){const{id:r=0,title:u=null,icon:b=null,iconText:a=null,showTitle:C=!0,stateText:m=null,stateIcon:z=null}=n,f=this,W=document.createElement("li"),Bt=o[r]??!1,B=I(`
<button class="menu-button-item${Bt?" selected":""}" ${pt(u)} data-id="${r}"" id="${f.name}_menuItem_${r}">
${mt(b)}
${C?dt(u):""}
${m||z?vt(m,z):""}
</button>
`);return c&&(c._button=B),B.addEventListener("keydown",p=>{var v;const d=()=>{p.stopPropagation(),p.preventDefault()};if(p.key==="ArrowUp"){const P=B.dataPrev;P==null||P.focus(),d()}else if(p.key==="ArrowDown"){const P=B.dataNext;P==null||P.focus(),d()}else if(p.key==="Tab"){const P=p.shiftKey?p.target.dataPrev:p.target.dataNext;P==null||P.focus(),d()}else p.key==="Escape"&&(this.player.playbackBar.popUp.pop()?(v=f.button)==null||v.focus():this.focus(),d())}),B.addEventListener("click",async p=>{if(t==="check"){const v=s.find(d=>d.id===r);o[r]=!o[r],f.itemSelected(v,s)}else if(t==="radio"){o[r]=!0;let v=null;s.forEach(d=>{d.id===r?v=d:o[d.id]=!1}),f.itemSelected(v,s)}else{const v=s.find(d=>d.id===r);f.itemSelected(v,s)}await f.checkRefreshContent(),p.stopPropagation(),f.closeOnSelect&&(f.closeMenu(),it(f.player))}),W.appendChild(B),e.appendChild(W),W}class _t extends ht{get closeOnSelect(){return this.config.closeOnSelect===void 0&&(this.buttonType!=="check"?this.config.closeOnSelect=!0:this.config.closeOnSelect=!1),this.config.closeOnSelect}setSelected(t,e){this._selectedItems&&(this._selectedItems[t]=e)}async getContent(){var t,e;const s=(t=document.activeElement)==null?void 0:t.id,i=I("<menu></menu>");this._content=i;const o=await this.getMenu();this._menuItems=o,this._selectedItems||(this._selectedItems={},this._menuItems.forEach(u=>{u.selected!==void 0&&u.selected!==null&&(this._selectedItems[u.id]=u.selected)}));const c=self.crypto.randomUUID(),r=o.map(u=>yt.apply(this,[{itemData:u,buttonType:typeof this.buttonType=="function"?this.buttonType():this.buttonType,container:i,allItems:o,menuName:c,selectedItems:this._selectedItems,itemPlugin:u.plugin}]));return r.forEach((u,b,a)=>{const C=u.querySelector("button");let m=a[b+1],z=a[b-1];b===a.length-1&&(m=a[0]),b===0&&(z=a[a.length-1]),C.dataNext=m==null?void 0:m.querySelector("button"),C.dataPrev=z==null?void 0:z.querySelector("button")}),this._firstItem=(e=r[0])==null?void 0:e.querySelector("button"),s&&setTimeout(()=>{var u;(u=document.getElementById(s))==null||u.focus()},10),i}get menuTitle(){return this.config.menuTitle||null}async getMenu(){return[{id:0,title:"Option 1"},{id:1,title:"Option 2"},{id:2,title:"Option 3"},{id:3,title:"Option 4"},{id:4,title:"Option 5"}]}get menuItems(){return this._menuItems}get showTitles(){return!0}get buttonType(){return"radio"}itemSelected(t,e){this.player.log.warn(`MenuButtonPlugin (${this.name}): itemSelected() function not implemented.`)}closeMenu(){this.player.playbackBar.popUp.hide()}async showPopUp(){this.refreshContent=!0,await super.showPopUp(),this.player.containsFocus&&this._firstItem&&this._firstItem.focus()}}Object.freeze({DISABLED:0,ERROR:1,WARN:2,INFO:3,DEBUG:4,VERBOSE:5}).INFO;const Y={name:"@asicupv/paella-zoom-plugin",version:"2.2.2"},bt={de:{"Zoom in":"Zoom in","Zoom out":"Zoom out","Show video zoom options":"Zoom-Optionen anzeigen","Use Alt+Scroll to zoom":"Zum Zoomen Alt+Rollen drücken"},en:{"Zoom in":"Zoom in","Zoom out":"Zoom out","Show video zoom options":"Show video zoom options","Use Alt+Scroll to zoom":"Use Alt+Scroll to zoom"},es:{"Zoom in":"Ampliar zoom del vídeo","Zoom out":"Reducir zoom de vídeo","Show video zoom options":"Mostrar opciones de zoom de vídeo","Use Alt+Scroll to zoom":"Usar Alt+Desplazamiento para hacer zoom"}};let N=null;class y extends rt{static Get(){return N||(N=new y),N}get moduleName(){return Y.name}get moduleVersion(){return Y.version}async getDictionaries(){return bt}}function x(n,t,e){const s={w:n.offsetWidth,h:n.offsetHeight},i={left:s.w/2,top:s.h/2};t.style.width=`${e*100}%`,t.style.height=`${e*100}%`;const o={left:t.offsetLeft,top:t.offsetTop,w:t.offsetWidth,h:t.offsetHeight},c={left:o.w/2,top:o.h/2},r={left:c.left-i.left,top:c.top-i.top};return e==1?(t.style.left="0px",t.style.top="0px",r.left=i.left,r.top=i.top):(t.style.left=`-${r.left}px`,t.style.top=`-${r.top}px`),r}function Ct(n,t,e){const s={left:t.left+e.left,top:t.top+e.top},i=n.parentElement;return n.style.top=`-${s.top}px`,n.offsetHeight+n.offsetTop-i.offsetHeight<0&&(s.top=t.top),n.style.left=`-${s.left}px`,n.offsetWidth+n.offsetLeft-i.offsetWidth<0&&(s.left=t.left),s}class _ extends ut{constructor(t,e,s){super("div",t,e),this.config=s,this._maxZoom=this.config.maxZoom||4,this._showButtons=this.config.showButtons!==void 0?this.config.showButtons:!0}async loadCanvas(t){this.currentZoom=1,this._videoPlayer=t,t.element.style.width="100%",t.element.style.height="100%",t.element.style.position="absolute",t.element.style.top="0",t.element.style.left="0",this.element.style.overflow="hidden",this.element.style.position="relative";const e=a=>{if(a.stopPropagation(),!a.altKey){this.showAltKeyMessage();return}this.hideAltKeyMessage();const C=a.deltaY!==void 0?a.deltaY*.1:a.detail*4,m=this.currentZoom+C*-.01;m>1&&m<=this._maxZoom?(this.currentZoom=m,this._playerCenter=x(this.element,this._videoPlayer.element,this.currentZoom)):m<=1&&(this.currentZoom=1,this._playerCenter=x(this.element,this._videoPlayer.element,this.currentZoom)),a.preventDefault()};this.element.addEventListener("DOMMouseScroll",e),this.element.addEventListener("mousewheel",e);let s=!1,i=!1,o=null;const c=()=>s=!0,r=()=>s=!1,u=a=>{i&&(a.stopPropagation(),a.preventDefault())};this.element.addEventListener("mousedown",c),this.element.addEventListener("mouseleave",r),this.element.addEventListener("mouseup",r),this.element.addEventListener("click",u),this.element.addEventListener("mouseup",u),this.element.addEventListener("mousemove",a=>{if(s&&this._playerCenter){o===null&&(o={left:a.clientX,top:a.clientY}),i=!0;const C={left:o.left-a.clientX,top:o.top-a.clientY};this.currentZoom==1?this._playerCenter={left:0,top:0}:this._playerCenter=Ct(this._videoPlayer.element,this._playerCenter,C),o={left:a.clientX,top:a.clientY}}else i=!1,o=null});const b=this.player.translate("Use Alt+Scroll to zoom");this._zoomMessage=I(`
<div class="zoom-message">${b}</div>
`,this.element),this._zoomMessage.style.display="none"}showAltKeyMessage(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._zoomMessage.style.display="",this._hideTimeout=setTimeout(()=>{this.hideAltKeyMessage()},2e3)}hideAltKeyMessage(){this._zoomMessage.style.display="none",this._hideTimeout=null}zoomIn(){const t=this.currentZoom*1.1;t<this._maxZoom&&(this.currentZoom=t,this._playerCenter=x(this.element,this._videoPlayer.element,this.currentZoom))}zoomOut(){const t=this.currentZoom*.9;t>=1&&(this.currentZoom=t,this._playerCenter=x(this.element,this._videoPlayer.element,this.currentZoom))}}let X=class extends ct{getPluginModuleInstance(){return y.Get()}get name(){return super.name||"es.upv.paella.zoomPlugin"}get canvasType(){return"video"}isCompatible(t){return!Array.isArray(t.canvas)||t.canvas.length===0?!0:super.isCompatible(t)}getCanvasInstance(t){return new _(this.player,t,this.config)}};const k=`<svg width="100%" height="100%" viewBox="0 0 32 32" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<path d="M17.094,18.048C15.976,18.956 14.551,19.5 13,19.5C9.413,19.5 6.5,16.587 6.5,13C6.5,9.413 9.413,6.5 13,6.5C16.587,6.5 19.5,9.413 19.5,13C19.5,14.522 18.976,15.923 18.098,17.031L19.553,18.487C20.094,17.958 20.962,17.962 21.498,18.498L25.522,22.522C26.062,23.062 26.062,23.938 25.522,24.478L24.519,25.481C23.98,26.02 23.103,26.02 22.563,25.481L18.539,21.457C18,20.917 18,20.041 18.539,19.501L18.543,19.497L17.094,18.048ZM13,8C15.76,8 18,10.24 18,13C18,15.76 15.76,18 13,18C10.24,18 8,15.76 8,13C8,10.24 10.24,8 13,8ZM13.927,11.886L15.927,11.886L15.927,13.886L13.927,13.886L13.927,15.886L11.927,15.886L11.927,13.886L9.927,13.886L9.927,11.886L11.927,11.886L11.927,9.886L13.927,9.886L13.927,11.886Z"/>
</svg>`;let J=class extends D{getPluginModuleInstance(){return y.Get()}get name(){return super.name||"es.upv.paella.zoomInButtonPlugin"}getAriaLabel(){return"Zoom in"}getDescription(){return this.getAriaLabel()}async isEnabled(){return await super.isEnabled()?(this.target=this.config.target,this._canvas=this.player.videoContainer.streamProvider.streams[this.target].canvas,this._canvas instanceof _):!1}async load(){this.icon=this.player.getCustomPluginIcon(this.name,"zoomInIcon")||k}async action(){this._canvas.zoomIn()}};const R=`<svg width="100%" height="100%" viewBox="0 0 32 32" version="1.1" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<path d="M17.094,18.048C15.976,18.956 14.551,19.5 13,19.5C9.413,19.5 6.5,16.587 6.5,13C6.5,9.413 9.413,6.5 13,6.5C16.587,6.5 19.5,9.413 19.5,13C19.5,14.522 18.976,15.923 18.098,17.031L19.553,18.487C20.094,17.958 20.962,17.962 21.498,18.498L25.522,22.522C26.062,23.062 26.062,23.938 25.522,24.478L24.519,25.481C23.98,26.02 23.103,26.02 22.563,25.481L18.539,21.457C18,20.917 18,20.041 18.539,19.501L18.543,19.497L17.094,18.048ZM13,8C15.76,8 18,10.24 18,13C18,15.76 15.76,18 13,18C10.24,18 8,15.76 8,13C8,10.24 10.24,8 13,8ZM9.927,11.886L15.927,11.886L15.927,13.886L9.927,13.886L9.927,11.886Z"/>
</svg>`;let Q=class extends D{getPluginModuleInstance(){return y.Get()}get name(){return super.name||"es.upv.paella.zoomOutButtonPlugin"}getAriaLabel(){return"Zoom out"}getDescription(){return this.getAriaLabel()}async isEnabled(){return await super.isEnabled()?(this.target=this.config.target,this._canvas=this.player.videoContainer.streamProvider.streams[this.target].canvas,this._canvas instanceof _):!1}async load(){this.icon=this.player.getCustomPluginIcon(this.name,"zoomOutIcon")||R}async action(){this._canvas.zoomOut()}},tt=class extends _t{getPluginModuleInstance(){return y.Get()}get name(){return super.name||"es.upv.paella.zoomMenuButtonPlugin"}getAriaLabel(){return"Show video zoom options"}getDescription(){return this.getAriaLabel()}async isEnabled(){return await super.isEnabled()?(this._target=this.config.target||"presenter",this._canvas=this.player.videoContainer.streamProvider.streams[this._target].canvas,this._canvas instanceof _):!1}async load(){this.icon=this.player.getCustomPluginIcon(this.name,"zoomInIcon")||k}async getMenu(){return[{id:"in",title:"Zoom in",icon:this.player.getCustomPluginIcon(this.name,"zoomInIcon")||k},{id:"out",title:"Zoom out",icon:this.player.getCustomPluginIcon(this.name,"zoomOutIcon")||R}]}get buttonType(){return"button"}get showTitles(){return!1}itemSelected(t){switch(t.id){case"in":this._canvas.zoomIn();break;case"out":this._canvas.zoomOut();break}}},et=class extends V{getPluginModuleInstance(){return y.Get()}get name(){return super.name||"es.upv.paella.canvasZoomInButtonPlugin"}async isEnabled(){if(!await super.isEnabled())return!1;let t=!1;this._streams=this.player.videoContainer.streamProvider.streams;for(const e in this._streams)t||(t=this._streams[e].canvas instanceof _);return t}async load(){this.icon=this.player.getCustomPluginIcon(this.name,"zoomInIcon")||k}async action(t,e,s,i){s instanceof _&&s.zoomIn()}},nt=class extends V{getPluginModuleInstance(){return y.Get()}get name(){return super.name||"es.upv.paella.canvasZoomOutButtonPlugin"}async isEnabled(){if(!await super.isEnabled())return!1;let t=!1;this._streams=this.player.videoContainer.streamProvider.streams;for(const e in this._streams)t||(t=this._streams[e].canvas instanceof _);return t}async load(){this.icon=this.player.getCustomPluginIcon(this.name,"zoomOutIcon")||R}async action(t,e,s,i){s instanceof _&&s.zoomOut()}};const st=[{plugin:X,config:{enabled:!1}},{plugin:J,config:{enabled:!1}},{plugin:Q,config:{enabled:!1}},{plugin:tt,config:{enabled:!1}},{plugin:et,config:{enabled:!1}},{plugin:nt,config:{enabled:!1}}],Pt=st,It=X,wt=J,Lt=Q,Tt=tt,Zt=et,zt=nt;h.CanvasZoomInButtonPlugin=Zt,h.CanvasZoomOutButtonPlugin=zt,h.ZoomCanvasPlugin=It,h.ZoomInButtonPlugin=wt,h.ZoomMenuButtonPlugin=Tt,h.ZoomOutButtonPlugin=Lt,h.allPlugins=Pt,h.zoomPlugins=st,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
//# sourceMappingURL=paella-zoom-plugin.umd.cjs.map