How to use the @vimeo/player.default function in @vimeo/player

To help you get started, we’ve selected a few @vimeo/player examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codecombat / codecombat / ozaria / site / components / cutscene / common / BaseVideo.vue View on Github external
mounted: function() {
    if (!(this.vimeoId || this.videoSrc)) {
      throw new Error('You must pass in a "vimeoId" or a "videoSrc"')
    }

    if (this.vimeoId) {
      const player = new VimeoPlayer('vimeo-player')
      player.ready().then(() => {
        player.play()
      })
      // TODO: Instead of emitting completed, requires end screen UI.
      //        Currently a stop gap to provide Intro support.
      player.on('ended', () => this.$emit('completed'))
    } else if (this.videoSrc) {
      new Plyr(this.$refs['player'], { captions: {active: true } })
    }
  }
}

@vimeo/player

Interact with and control an embedded Vimeo Player.

MIT
Latest version published 3 months ago

Package Health Score

84 / 100
Full package analysis

Popular @vimeo/player functions