Skip to content

Commit

Permalink
GitBook: [#80] Add ovenplayer-vue manual
Browse files Browse the repository at this point in the history
  • Loading branch information
SangwonOh authored and gitbook-bot committed May 20, 2022
1 parent de5744c commit 64af6fb
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ $ npm install ovenplayer
$ npm install ovenplayer@0.10.0
```

#### Vuejs component

```
$ npm install ovenplayer-vue3
```

## Quick Start

Below is a list of simple OvenPlayer initialization methods for each situation. For detailed options when initializing the OvenPlayer, please refer to the [Initialization](https://airensoft.gitbook.io/ovenplayer/initialization) chapter.
Expand Down Expand Up @@ -137,6 +143,50 @@ import OvenPlayer from 'ovenplayer';
const player = OvenPlayer.create('player_id', options)
```

### OvenPlayer for Vue.js

You can use OvenPlayer as a reusable [Vue.js](https://vuejs.org/) component.

```javascript
<script setup>
import OvenPlayerVue3 from "ovenplayer-vue3";
</script>

<template>
<OvenPlayerVue3
:config="playerConfig"
@ready="readyHandler"
@error="errorHandler"
>
</OvenPlayerVue3>
</template>

<script>
export default {
data() {
return {
playerConfig: {
sources: [
{
type: '...',
file: '...',
},
],
},
};
},
methods: {
readyHandler(event) {
//
},
errorHandler(event) {
//
}
}
};
</script>
```

### Initialize for OME

To play Sub-Second Latency Stream of OvenMediaEngine, set the source `type` to `webrtc`and set the `file` to the WebRTC Signaling URL with OvenMediaEngine. An explanation of the WebRTC Signaling URL can be found [here](https://airensoft.gitbook.io/ovenmediaengine/getting-started#playback).
Expand Down

0 comments on commit 64af6fb

Please sign in to comment.