I'm getting this, when trying to make a new Vimeo.Player instance.
What I did:
installed via npm. In my JS bootstrap file I added:
window.Vimeo = require('@vimeo/player');
Compiled with webpack.
The library exports the Player object directly, so when using require() it will return the constructor directly (meaning in this case you'd create it by doing new Vimeo()).
If you're using webpack, it probably makes more sense to import the player to a local variable that's referenced by whatever script is creating the player.
Thanks works like a charm. Maybe add this to the README ?
import Vimeo from '@vimeo/player'
let options = {
id: 59777392,
width: 640,
loop: true
}
let player = new Vimeo('made-in-ny', options);
window.Vimeo = require('@vimeo/player');
var player = new Vimeo.default('made-in-ny', options);
Most helpful comment
Thanks works like a charm. Maybe add this to the README ?