Coder Social home page Coder Social logo

redxtech / vue-plyr Goto Github PK

View Code? Open in Web Editor NEW
757.0 757.0 135.0 3.83 MB

A Vue component for the plyr (https://github.com/sampotts/plyr) video & audio player.

License: Other

JavaScript 71.92% Vue 19.40% HTML 8.68%
audio audio-player component hacktoberfest plyr plyr-plugin video video-player vue

vue-plyr's Introduction

vue-plyr

v7.0.0 - Changelog

A vue component for the plyr video & audio player.

This is useful for when you want a nice video player in your Vue app.

It uses plyr by sampotts for the players.

Supported player types: HTML5 video, HTML5 audio, YouTube, and Vimeo.

Demo

A demo of the components (equivalent to the html example include here) can be found at redxtech.github.io/vue-plyr.

Installation

yarn add vue-plyr # or npm i vue-plyr

Module

// In your main vue file - the one where you create the initial vue instance.
import Vue from 'vue'
import VuePlyr from 'vue-plyr'
import 'vue-plyr/dist/vue-plyr.css'

// Vue 3.x
// The second argument is optional and sets the default config values for every player.
createApp(App)
  .use(VuePlyr, {
    plyr: {}
  })
  .mount('#app')

// Vue 2.x
// The second argument is optional and sets the default config values for every player.
Vue.use(VuePlyr, {
  plyr: {}
})

For SSR, you can import the SSR optimized module, found at dist/vue-plyr.ssr.js. There is a more in depth description on how to use it with nuxt below.

Browser

In the browser you can include it as you would any other package with unpkg, along with the stylesheet:

<script type="text/javascript" src="https://unpkg.com/vue"></script>
<script type="text/javascript" src="https://unpkg.com/vue-plyr"></script>
<link rel="stylesheet" href="https://unpkg.com/vue-plyr/dist/vue-plyr.css" />

<!-- You will also need to install the component during app creation -->
<script>
  window.Vue.createApp(VuePlyr).mount('#app')
</script>

Usage

Once installed, it can be used in a template as simply as:

<!-- video element -->
<vue-plyr :options="options">
  <video
    controls
    crossorigin
    playsinline
    data-poster="poster.jpg"
  >
    <source
      size="720"
      src="/path/to/video-720p.mp4"
      type="video/mp4"
    />
    <source
      size="1080"
      src="/path/to/video-1080p.mp4"
      type="video/mp4"
    />
    <track
      default
      kind="captions"
      label="English captions"
      src="/path/to/english.vtt"
      srclang="en"
    />
  </video>
</vue-plyr>

<!-- audio element -->
<vue-plyr>
  <audio controls crossorigin playsinline>
    <source
        src="/path/to/audio.mp3"
        type="audio/mp3"
    />
    <source
        src="/path/to/audio.ogg"
        type="audio/ogg"
    />
  </audio>
</vue-plyr>

<!-- youtube iframe with progressive enhancement (extra queries after the url to optimize the embed) -->
<vue-plyr>
  <div class="plyr__video-embed">
    <iframe
      src="https://www.youtube.com/embed/bTqVqk7FSmY?amp;iv_load_policy=3&amp;modestbranding=1&amp;playsinline=1&amp;showinfo=0&amp;rel=0&amp;enablejsapi=1"
      allowfullscreen
      allowtransparency
      allow="autoplay"
    ></iframe>
  </div>
</vue-plyr>

<!-- youtube div element -->
<vue-plyr>
  <div data-plyr-provider="youtube" data-plyr-embed-id="bTqVqk7FSmY"></div>
</vue-plyr>

<!-- vimeo iframe with progressive enhancement (extra queries after the url to optimize the embed) -->
<vue-plyr>
  <div class="plyr__video-embed">
    <iframe
      src="https://player.vimeo.com/video/143418951?loop=false&amp;byline=false&amp;portrait=false&amp;title=false&amp;speed=true&amp;transparent=0&amp;gesture=media"
      allowfullscreen
      allowtransparency
      allow="autoplay"
    ></iframe>
  </div>
</vue-plyr>

<!-- vimeo div element -->
<vue-plyr>
  <div data-plyr-provider="vimeo" data-plyr-embed-id="143418951"></div>
</vue-plyr>

Player Instance

To access the player instance, you can use the player property from the refs attribute.

<template>
  <vue-plyr ref="plyr">...</vue-plyr>
</template>

<script>
  export default {
    name: 'Component',
    mounted () {
      console.log(this.$refs.plyr.player)
    }
  }
</script>

Examples

Examples of how to use this app can be found here.

Events

If you want to capture events from the plyr instance, you can do so by accessing the player instance through the ref attribute and using that object for events, as you would with a vanilla plyr instance.

Valid events are here.

<template>
  <vue-plyr ref="plyr">...</vue-plyr>
</template>
<script>
  export default {
    name: 'Component',
    mounted () {
      this.$refs.plyr.player.on('event', () => console.log('event fired'))
    }
</script>

Options

For custom options you can pass an options prop which is an object that will be passed to the new Plyr() creation. Available options here. I have added a new option (hideYouTubeDOMError) that hides the error that is always logged when destroying a YouTube player. It defaults to true, and you can disable it and see the error by setting it to false.

You can also specify the default options when registering the plugin (these will be ignored if you specify a player-specific options object via props):

createApp(App).use(VuePlyr, {
  plyr: {}
})

SSR

Nuxt (Vue 2.x)

This should support SSR out of the box. For nuxt, create a file called vue-plyr.js in your plugins folder containing only these three statements:

import Vue from 'vue'
import VuePlyr from 'vue-plyr/dist/vue-plyr.ssr.js'
import 'vue-plyr/dist/vue-plyr.css'

// The second argument is optional and sets the default config values for every player.
Vue.use(VuePlyr, {
  plyr: {}
})

Then, in your nuxt.config.js file add { src: '~/plugins/vue-plyr', mode: 'client' } to the plugins array. The vue-plyr element should be globally registered now.

The nuxt.config.js file should at minimum include this:

export default {
  plugins: [{ src: '~/plugins/vue-plyr', mode: 'client' }]
}

Author

vue-plyr © RedXTech, Released under the MIT License.

vue-plyr's People

Contributors

achendrick avatar alexey-pd avatar dappiu avatar dependabot-preview[bot] avatar dependabot[bot] avatar dib258 avatar irazasyed avatar jwjcmw avatar mkody avatar mvaneijgen avatar nathakits avatar redxtech avatar vangog avatar zcuric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-plyr's Issues

Documentation leaves readers thinking vue-plyr works with nuxt

This section needs to be changed: https://github.com/redxtech/vue-plyr#ssr
The way it is now, causes people (users of nuxt) to think that there is something wrong with them, and they will try for hours to figure out what it is they're doing wrong in the hope of getting vue-plyr working with their site. I think that's not very respectful of other human beings and their time.

Another option is to resolve this issue is by fixing bug #43 (which has been there for two months).

Add UMD bundle

Currently you only have CommonJS bundle which can't be used in browser directly.

library: true,

poi build --library && poi build --library VuePlyr would fix it, in this case you should remove removeDist: true

YouTube origin error and multiple modals with video

I'm having this same issue as the #27 with the latest version on NPM.

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://localhost:8080').

I'm using the plyr player on a modal and when I show the modal the error occurs.

I'm not sure if it's related but if I close the modal and open a new one with a different video this one doesn't load, and if I go back to the first modal the video doesn't show as well.

Accessing player object

The plyr documentation states that you can access the player object through 2 ways:

  1. Setting the return value from your call to the constructor to a variable
  2. Accessing the object through any events.

Because I am using vue-plyr I am not directly calling the constructor thus making option 1 not feasible.

I tried option 2 as follows but end up with a null

:emit="['play']" @play="didPlay"

methods: { didPlay(event) { const player = $(event.target); // returns DOM element correctly const playerObj = event.detail.plyr; // null }

Does anyone know how I can access the actual player object? I need to do some manual method calls.

Thanks!

Syntax error when using with Nuxt

I created a fresh nuxt app (with npx create-nuxt-app my-plyr), and did npm i vye-plyr plyr, and added the created ~/plugins/vue-plyr.js with the two lines you mention:

import 'vue-plyr'
import 'vue-plyr/dist/vue-plyr.css'

and included '~/plugins/vue-plyr.js' in nuxt.config.js's plugins array.

I.e. I did everything as I should.

But npm run dev fails with an error:

 ERROR  Failed to compile with 1 errors                                                                                                                                                                  4:16:54 AM

 error  in ./node_modules/plyr/dist/plyr.css

Module build failed (from ./node_modules/css-loader/index.js):
Unclosed bracket (1:9688)

Dist version seems different?

It looks like the compiled version is different as when I try to import, It says there is no VuePlyr and upon looking up the dist files, it is a different version than the one it should be.

I'm using v5 BTW.

Please check the unpkg version to know what I mean.

Changelog?

Hello,
Is there a changelog? You recently updated from 3 to 4 version. There seem to be some notable changes...

Player destroy throwing errors since v3

Seems like I'm back with another issue 😨

I did get to test the implementation today fully and throughout and noticed some issues that were not happening with v2 but are happening with v3. I'm unsure if this related to SSR only since I can currently not test this on a non-SSR env.

Anyway.
image

This is very simple to reproduce:

  • Have a main view with no plyr players
  • Navigate to a view with 2 or 3 plyr players
  • Navigate away or back to the main view

I tested both ways:

// index.js
import VuePlyr from 'vue-plyr';
Vue.use(VuePlyr);

// someView.vue
<template>
    <plyr v-if="props.row.snippet">
        <audio controls
            preload="none">
                <source :src="`https://cdn.listen.moe/snippets/${props.row.snippet}`"
                    type="audio/mpeg"></audio>
    </plyr>
</template>

and

// someView.vue
<template>
    <plyr v-if="props.row.snippet">
        <audio controls
            preload="none">
                <source :src="`https://cdn.listen.moe/snippets/${props.row.snippet}`"
                    type="audio/mpeg"></audio>
    </plyr>
</template>

<script>
if (process.browser) var { Plyr } = require('vue-plyr');

export default {
	components: { plyr: Plyr }
}
</script>

The latter works with v2 flawless, but not with v3 anymore.
"But not anymore" as in it throws those errors, they do not break the site or anything, the plyr instances still get recreated on a new visit to the view and play perfectly fine. The console spam is real though, especially if you display a lot of plyr instances.

controls stretched out of video frame

I have a cordova F7 project that I'm trying to using your nice components with.
I added

import VuePlyr from 'vue-plyr';
import 'vue-plyr/dist/vue-plyr.css';
Vue.use(VuePlyr)

to the main.js file and have a simple template in which I'm trying to use Plyr:

<template>
  <f7-page>
    <f7-navbar title="This month's video" back-link="Back"></f7-navbar>

    <div class="block">    
    <plyr>             
      <video>
        <source src="static/videos/video.mp4" type="video/mp4"> 
      </video>                                                  
    </plyr>                                         
    </div>    
  </f7-page>
</template> 
            
<script>
  import { f7Navbar, f7Page, f7BlockTitle } from 'framework7-vue';
                                                                  
  export default {                                                
    components: {                                                 
      f7Navbar,                                                   
      f7Page,     
      f7BlockTitle,
    },             
  };                     
</script>

I end up with a plyr player that has the controls stretched off the side of the video frame like so:
screenshot from 2018-04-29 16-23-04
Is this an issue with vue-plyr, plyr itself, or am I using these wrong?

Unclosed bracket error?

Hi, I'm getting this error when using vue-plyr on nuxt 2.2
Does anyone know how to fix it?
Thanks!

ERROR in ./node_modules/plyr/dist/plyr.css (./node_modules/css-loader??ref--3-oneOf-1-1!./node_modules/postcss-loader/src??ref--3-oneOf-1-2!./node_modules/plyr/dist/plyr.css)
Module build failed (from ./node_modules/css-loader/index.js):
Unclosed bracket (1:9591) 

Unable to use with electron web pack.

I am using VueJs-plyr with electron-vue template using npm. When I try to register vue-plyr, i get following error:

/Users/kksai/ClientW…lyr/dist/plyr.css:1 Uncaught SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80)
    at Object.runInThisContext (vm.js:139)
    at Module._compile (module.js:606)
    at Object.Module._extensions..js (module.js:653)
    at Module.load (module.js:561)
    at tryModuleLoad (module.js:504)
    at Function.Module._load (module.js:496)
    at Module.require (module.js:586)
    at require (internal/module.js:11)
    at Object.<anonymous> (/Users/kksai/ClientW…t/vue-plyr.cjs.js:8)

Can you help to find out what is the problem?

source setter

How do I use the .source setter on the vue-plyr? the regular js plyr example for youtube is:
player.source = {
type: 'video',
sources: [
{
src: 'bTqVqk7FSmY',
provider: 'youtube',
},
],
};

SSR compability

Is there any plan on doing this?

I saw in #7 that you plan on upgrading to plyr version 3, so could you take a look at that?
It's basically just checking if window exists before doing any operations that only the client should do.

Something like if (typeof window !== 'undefined') should usually do the trick.
If that isn't desired, I can maintain my own fork.

Cheers.

Events not firing on SSR setup

I am using vue-plyr in a nuxt setup, thanks for this wrapper! I am experiencing trouble with getting the events to be fired, my setup within a component (using pug) is:

vue-plyr(@timeupdate="onPlay")

and then mounting a Vimeo player with

div(data-plyr-provider="vimeo" :data-plyr-embed-id="vid")

Am I missing something?

Controls are not reactive

Reactivity is broken for controls:
I have an audio player that has 2 states: minimised and full (var fullview), in which some controls are hidden/shown (think of spotify). The problem is that the controls for the players do not update according to the state.

<vue-plyr ref="plyr" id="audioPlayer" :options="{ controls: controls }">
    <audio>
        <source :src='content' type="audio/mp3">
     </audio>
</vue-plyr>
 ...
computed: {
    controls () {
      if (this.fullview) {
        return `<div class="plyr__controls">
              <button type="button" class="plyr__control" data-plyr="rewind">
                  <svg role="presentation"><use xlink:href="#plyr-rewind"></use></svg>
                  <span class="plyr__tooltip" role="tooltip">Rewind {seektime} secs</span>
              </button>
              <button type="button" class="plyr__control" aria-label="Play, {title}" data-plyr="play">
                  <svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-pause"></use></svg>
                  <svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-play"></use></svg>
                  <span class="label--pressed plyr__tooltip" role="tooltip">Pause</span>
                  <span class="label--not-pressed plyr__tooltip" role="tooltip">Play</span>
              </button>
              <button type="button" class="plyr__control" data-plyr="fast-forward">
                  <svg role="presentation"><use xlink:href="#plyr-fast-forward"></use></svg>
                  <span class="plyr__tooltip" role="tooltip">Forward {seektime} secs</span>
              </button>
              <div class="plyr__progress">
                  <input data-plyr="seek" type="range" min="0" max="100" step="0.01" value="0" aria-label="Seek">
                  <progress class="plyr__progress__buffer" min="0" max="100" value="0">% buffered</progress>
                  <span role="tooltip" class="plyr__tooltip">00:00</span>
              </div>
              <div class="plyr__time plyr__time--current" aria-label="Current time">00:00</div>
              <div class="plyr__time plyr__time--duration" aria-label="Duration">00:00</div>
              <button type="button" class="plyr__control" aria-label="Mute" data-plyr="mute">
                  <svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-muted"></use></svg>
                  <svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-volume"></use></svg>
                  <span class="label--pressed plyr__tooltip" role="tooltip">Unmute</span>
                  <span class="label--not-pressed plyr__tooltip" role="tooltip">Mute</span>
              </button>
              <div class="plyr__volume">
                  <input data-plyr="volume" type="range" min="0" max="1" step="0.05" value="1" autocomplete="off" aria-label="Volume">
              </div>
              <button type="button" class="plyr__control" data-plyr="captions">
                  <svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-captions-on"></use></svg>
                  <svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-captions-off"></use></svg>
                  <span class="label--pressed plyr__tooltip" role="tooltip">Disable captions</span>
                  <span class="label--not-pressed plyr__tooltip" role="tooltip">Enable captions</span>
              </button>
              <button type="button" class="plyr__control" data-plyr="fullscreen">
                  <svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-exit-fullscreen"></use></svg>
                  <svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-enter-fullscreen"></use></svg>
                  <span class="label--pressed plyr__tooltip" role="tooltip">Exit fullscreen</span>
                  <span class="label--not-pressed plyr__tooltip" role="tooltip">Enter fullscreen</span>
              </button>
          </div>
          `
        } else {
          return `<div class="plyr__controls">
              <button type="button" class="plyr__control" aria-label="Play, {title}" data-plyr="play">
                  <svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-pause"></use></svg>
                  <svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-play"></use></svg>
                  <span class="label--pressed plyr__tooltip" role="tooltip">Pause</span>
                  <span class="label--not-pressed plyr__tooltip" role="tooltip">Play</span>
              </button>
          </div>
          `
        }
    }
}

I can remedy this by adding :key="fullview" to the vue-plyr element but it has its drawbacks, seeing that refreshing the component that way stops playback. So I am currently doing it through css but I think It would be useful if the component controls were reactive.

Versions: [email protected], plyr@^3.5.2

Invalid CSS

dist/vue-plyr.css includes wrong value --value.

here is error that shown by postcss-loader:

variable '--value' is undefined and used without a fallback
 @ ./node_modules/vue-plyr/dist/vue-plyr.css 4:14-121

image

vue-plyr module not downloading

Hi,
vue-plyr was previously working fine, after some update I am unable to download this package using npm , Its always prompting for npm install, even after downloading multiple times.

Build css fail with Nuxtjs

error in ./node_modules/plyr/dist/plyr.css
Module build failed (from ./node_modules/css-loader/index.js):
Unclosed bracket (1:9591)

@ ./node_modules/plyr/dist/plyr.css 4:14-133 14:3-18:5 15:22-141
@ ./node_modules/vue-plyr/dist/vue-plyr.es.js
@ ./plugins/vue-plyr.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/__webpack_hmr ./.nuxt/client.js

Watching events on plyr instance

I'd love any advice on what the best way to monitor events in the player instance that is created by this component from a parent component. I was able to do it by using plyr in the parent component to find any instances...but I don't have access to the unique id to make sure I'm getting the right one. Would it make sense to have the vue-plyr components $emit the unique id? Is there a better way to do this?

Can't reload source dynamic

Hi,

I'm trying to chance source value dynamic but nothing happens, Am I missing something?

<plyr>
   <audio>
     <source :src="episode" format="audio/mp3">
   </audio>
</plyr>

<button @click="episode = 'https://archive.org/download/testmp3testfile/mpthreetest.mp3' ">x</button>
<button @click="episode = 'https://archive.org/download/DiegomcnamaraPodcast/podcast_64kb.mp3'">y</button>```

Cannot read property 'player' of undefined on Nuxt

 <vue-plyr ref='plyr' >
  <div class="plyr__video-embed" @click='(e)=>e.stopPropagation()'>
    <iframe :src="`https://www.youtube.com/embed/${youtube_id}iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1`"
                allowfullscreen allowtransparency allow="autoplay">
    </iframe>
  </div>
</vue-plyr>
computed: {
  player () {
    return this.$refs.plyr.player
  }
}

what am i missing?

Can't get options to work

I specify the config in data like

options: {
     volume: 0
},
<plyr-video :options="options"  :videos="videos"  :crossorigin="true" />

Responsive Styling - width ignored

For an internal project we tried using this inside a Modal window. Haven't had much time to debug as of yet. When I get more time in the day I'll try to update this issue but I wanted to go ahead and capture it now.

It seems the player ignores responsive styling on iOS devices (all we've checked so far).

iOS 11, Chrome and Safari

On desktop it appears to work fine. I apologize, I know this doesn't give a lot of info for now. I'll update later.

Duplicate Vue.js code

That seems like a bug to me, as https://unpkg.com/vue-plyr@latest includes whole lot of Vue code (>8k lines). Same applies to dist/vue-plyr.js file when I install via yarn.

I'm new to Vue, but from JS standpoint that seems completely unnecessary and wrong, as this is why you would include Vue.js before including vue-plyr.

Because of that I'm getting You are running Vue in development mode. message twice in console

I'm also getting below, though I'm not quite sure it's related:

Unknown custom element: <vue-plyr> - did you register the component correctly?

I confirmed that the component registration code in vue-plyr.js is executed, but then calling Vue.options.components does not list it.

If I'm however wrong and it's my fault, then please excuse me - as I mentioned, I'm new to Vue ;)

npm version 2.1.1

It looks like the version 2.1.1 that is on npm isn't correct...it doesn't have the emit code. I was trying to use that as I have some custom stuff that still requires plyr 2. Any chance of updating it?

Can It Work For Nuxt.js?

Wow! I love these player. I am building an app with Nuxt.js and i require having a player and a playlist.
Please can these plugin work with Nuxt.js?

Hooking into events on button presses

Hi there,

I'm looking to hook into certain buttons and changes rather than the events themselves. The problem with hooking into the play event or the state change for example, is that as far as I can see you can't tell if the play/pause button was pressed. Same goes for volume and seeking.

Is there anyway to differentiate between a button click or an event?

Thanks for the package - it's been a huge help.

Programmatically controlling the Video

Great package.

I'm a bit confused on how I can control the playback programatically. I'm showing the player in a modal and when it gets closed I need the playback to be paused, if it's reopened then to play.

I'm sure there's a simple way to do that, I'm just not seeing it in your documentation.

Thanks.

CJS incompatible

Can we remove this line here:
https://github.com/redxtech/vue-plyr/blob/master/src/VuePlyr.vue#L9

import 'plyr/dist/plyr.css'

I feel its unnecessary in there and you could just mention, like in previous versions to to import:
import 'vue-plyr/dist/plyr.css'

The reason it breaks is simple if you look into the dist/ folder vue-plyr.cjs.js, the import transpiles down to require('plyr/dist/plyr.css') which throws a nice error since a css file is sadly not something require can handle.

ESLint complains: no-named-as-default

There are complaints on the build phase with bili:

Using named and default exports together. Consumers of your bundle will have to use bundle['default'] to access the default export, which may not be what you want. Use output.exports: 'named' to disable this warning

But also from the user side when importing VuePlyr without braces (I use eslint with vue/recommended plugin)

Using exported name 'VuePlyr' as identifier for default export.eslint(import/no-named-as-default)

index.js:

  1. imports the default export of VuePlyr.vue calling it VuePlyr
  2. creates a const VuePlyrPlugin
  3. exports the VuePlyr as VuePlyr, VuePlyrPlugin as VuePlyrPlugin
  4. exports VuePlyrPlugin as module default

This is rather confusing. I'm proposing to fix the naming scheme, if the project mantainer would agree, but let's just decide what is the way to go. I do my proposals:

import VuePlyr from './VuePlyr.vue'

VuePlyr.install = function (Vue, options = {}) {
    Vue.component(VuePlyr.name, VuePlyr)
}
// ...parts redacted for brevity...
export default VuePlyr

This way we would stop both the complaints from build phase and from eslint on the user side.

We could also export the named component without the install method as VuePlyr as before, but then we should update documentation regarding imports changing them with import { VuePlyrPlugin as VuePlyr } from 'vue-plyr' to prevent such complaints

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.