vue-video-wrapper
Version:
A Vue.js component to wrap embed iframes from Vimeo and Youtube.
27 lines (21 loc) • 561 B
JavaScript
import videoWrapper from './player.js';
function install(Vue, options = {}) {
if (install.installed) return;
install.installed = true;
const { componentId = "video-wrapper" } = options;
Vue.component(componentId, videoWrapper);
}
const plugin = {
install
};
let GlobalVue = null;
if (typeof window !== "undefined") {
GlobalVue = window.Vue;
} else if (typeof global !== "undefined") {
GlobalVue = global.vue;
}
if (GlobalVue) {
GlobalVue.use(plugin);
}
videoWrapper.install = install;
export default videoWrapper;