UNPKG

@mycure/vue-jitsi-meet

Version:

Vue component for Jitsi Meet Web Integration via IFrame

2 lines (1 loc) 2.87 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t};function e(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function i(i){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){t(i,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))}))}return i}function n(t,e,i,n,r,o,s,c,a,d){"boolean"!=typeof s&&(a=c,c=s,s=!1);const p="function"==typeof i?i.options:i;let u;if(t&&t.render&&(p.render=t.render,p.staticRenderFns=t.staticRenderFns,p._compiled=!0,r&&(p.functional=!0)),n&&(p._scopeId=n),o?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,a(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},p._ssrRegister=u):e&&(u=s?function(t){e.call(this,d(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,c(t))}),u)if(p.functional){const t=p.render;p.render=function(e,i){return u.call(i),t(e,i)}}else{const t=p.beforeCreate;p.beforeCreate=t?[].concat(t,u):[u]}return i}const r={props:{domain:{type:String,default:"meet.jit.si"},options:{type:Object,default:function(){return{}}}},data:function(){return{jitsiApi:null}},mounted:function(){var t=this;this.loadScript("https://".concat(this.domain,"/external_api.js"),(function(){if(!window.JitsiMeetExternalAPI)throw new Error("Jitsi Meet External API not loaded");t.embedJitsiWidget()}))},beforeDestroy:function(){this.removeJitsiWidget()},methods:{loadScript:function(t,e){var i=document.createElement("script");i.src=t,i.async=1,document.querySelector("head").appendChild(i),i.addEventListener("load",e)},embedJitsiWidget:function(){var t=i(i({},this.options),{},{parentNode:this.$refs.jitsiContainer});this.jitsiApi=new window.JitsiMeetExternalAPI(this.domain,t)},executeCommand:function(t){for(var e,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(e=this.jitsiApi).executeCommand.apply(e,[t].concat(n))},addEventListener:function(t,e){this.jitsiApi.on(t,e)},removeJitsiWidget:function(){this.jitsiApi&&this.jitsiApi.dispose()}}};var o=function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"jitsiContainer",staticStyle:{height:"100%",width:"100%"}})};o._withStripped=!0;const s=n({render:o,staticRenderFns:[]},void 0,r,void 0,!1,void 0,!1,void 0,void 0,void 0);exports.JitsiMeet=s;