2.0.0 • Published 5 months ago

@kinescope/vue-kinescope-player v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 months ago

Vue wrapper for Kinescope Embed Player

Starting from version 2.0.0, this package works with Vue 3.

Installation

Using npm:

npm install @kinescope/vue-kinescope-player --save

Using yarn:

yarn add @kinescope/vue-kinescope-player

Getting Started

You can either import it in your whole project

import KinescopePlayer from '@kinescope/vue-kinescope-player'
import { createApp } from 'vue'

const app = createApp(App)
app.use(KinescopePlayer)
app.mount('#app')

or import it locally in a component

import { KinescopePlayer } from '@kinescope/vue-kinescope-player'

export default {
  components: { KinescopePlayer }
}
<!-- events -->
<template>
  <kinescope-player
    :video-id="200702846"
    @ready="handleReady"
    @play="handlePlay"
  ></kinescope-player>
</template>
<!-- methods -->
<template>
  <div>
    <kinescope-player
      ref="kinescope"
      :video-id='200702846'
      @ready="handleReady"
    ></kinescope-player>
    <button @click="handleClick" :disabled="!ready">Play</button>
  </div>
</template>

<script>
import { ref } from 'vue'
import { KinescopePlayer } from '@kinescope/vue-kinescope-player'

export default {
  components: { KinescopePlayer },
  setup() {
    const ready = ref(false)
    const kinescope = ref(null)

    const handleReady = () => {
      ready.value = true
    }

    const handleClick = () => {
      kinescope.value.player.play()
    }

    return {
      ready,
      kinescope,
      handleReady,
      handleClick
    }
  }
}
</script>

Props

Events

Methods

2.0.0

5 months ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

5 years ago