2.2.1 • Published 2 years ago

@retell/player-vue v2.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Vue Integration

Install


npm install @retell/player-vue
yarn add @retell/player-vue

Install the plugin into Vue:

import Vue from 'vue'
import RetellPlayer from '@retell/player-react'

Vue.use(RetellPlayer)

Usage


<template>
 <div>
  <retell-player />
 </div>
</template>

You can specify the articleUrl to create a player with the custom article at any place, if articleUrl is not specified, by default will be used a current page URL

<template>
 <div>
   <retell-player articleUrl="ABSOLUTE_LINK_TO_THE_ARTICLE" />
 </div>
</template>

Nuxt SSR Example

<template>
 <client-only>
   <retell-player />
 </client-only>
</template>

Props

NameTypeDefaultDescription
articleUrlStringCurrent page URLArticle URL
rateNumber1Player playback rate
widgetStringdefaultPlayer widget

Events

EventDescription
openedThis event fires when the player is successfully initialized
startThis event fires when the player start playing audio (first play)
resumeThis event fires on audio pause
pauseThis event fires on audio pause
endThis event fires when the audio is complete playing
progressThis event fires on audio playing progress multiples by 5.

Examples

<template>
 <retell-player
   @opened="onOpened"
   @progress="onProgress"
 />
</template>
<script>
export default {
 methods: {
  onOpened () {
   console.log('Player opened')
  },
  onProgress (event) {
   if ([25, 50, 75, 100].includes(event.data.progress)) {
    console.log('Player progress:', event.data.progress)
   }
  }
 }
}
</script>
2.2.1

2 years ago

2.2.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

3 years ago