multicam-player
v1.0.3
Published
Multicam player component for Vue 2 with swiper playlist and eb-player integration.
Maintainers
Readme
multicam-player
A small, fast Vue 2 component that renders a main video and a virtualized Swiper playlist of live previews. Designed for Nuxt 2 / Vue 2 apps. Ships ESM and UMD.
Install
yarn add multicam-player vue@^2 vue-awesome-swiper@^3 swiper@^6 eb-player@^1These are peer deps to avoid duplicates.
Nuxt usage
Create a plugin (e.g. plugins/multicam.js):
import Vue from 'vue'
import Multicam from 'multicam-player'
export default () => {
Vue.use(Multicam)
}Register in nuxt.config.js:
export default {
plugins: ['~/plugins/multicam.js'],
build: {
extend(config, { isClient }) {
// eb-player alias needed by the package
config.resolve.alias['~player'] = `eb-player/dist/build/${process.env.PLAYER_CONFIG || 'default'}.js`
}
}
}Then use it:
<template>
<MulticamPlayer :config="cams" :autoPlaylist="true" />
</template>Dev / debug
yarn install
export PLAYER_CONFIG=default # optional
yarn dev # http://localhost:8080The dev playground installs the plugin from src/ and hot-reloads.
Build
yarn build # outputs dist/multicam-player.{esm,umd}.jsPublish
npm publish --access publicProps
config: Array— list of cams; takes precedence overconfigUrlconfigUrl: String— endpoint returning the same shape asconfigautoPlaylist: Boolean— auto-hide/show the playlist on activitymulticamDebug: Boolean— show FPS/memory HUD
Notes
- The package auto-installs
eb-playervia Webpack alias~playerthat points toeb-player/dist/build/<name>.js. - Swiper CSS can be imported in your app if you prefer:
import 'swiper/swiper-bundle.css'.
License
MIT
