Vue Plyr Video and Audio Player

7.0.0 · active · verified Sun Apr 19

Vue-plyr is a component library that provides a seamless integration of the robust Plyr.io media player into Vue.js applications. It supports HTML5 video and audio, as well as embeds from YouTube and Vimeo, offering a consistent and customizable player experience. Currently at version 7.0.0, vue-plyr aligns with modern Vue 3 applications while also providing backward compatibility for Vue 2. Its release cadence typically follows updates to the underlying Plyr library and major Vue.js versions. A key differentiator is its straightforward API for embedding various media types and accessing the underlying Plyr instance for advanced control, simplifying the process compared to integrating Plyr directly. The library also includes specific support for Server-Side Rendering (SSR) environments like Nuxt.js, addressing common challenges in universal applications.

Common errors

Warnings

Install

Imports

Quickstart

Initializes a Vue 3 application, globally registers the `VuePlyr` component with default options, and demonstrates embedding an HTML5 video player.

import { createApp } from 'vue'
import App from './App.vue'
import VuePlyr from 'vue-plyr'
import 'vue-plyr/dist/vue-plyr.css'

const app = createApp(App)

app.use(VuePlyr, { plyr: {} })

app.mount('#app')

// In App.vue or another component:
// <template>
//   <vue-plyr :options="{autoplay: false, muted: false}">
//     <video controls crossorigin playsinline>
//       <source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4" type="video/mp4" />
//     </video>
//   </vue-plyr>
// </template>
// <script>
// export default {
//   name: 'App'
// }
// </script>

view raw JSON →