1
1
# vue-plyr
2
- > v5.1.3 - [ Changelog] ( https://github.com/redxtech/vue-plyr/blob/master/changelog.md )
2
+ > v6.0.0 - [ Changelog] ( https://github.com/redxtech/vue-plyr/blob/master/changelog.md )
3
3
4
- > A set of Vue components for the plyr video & audio player.
4
+ > A vue component for the plyr video & audio player.
5
5
6
6
This is useful for when you want a nice video player in your Vue app.
7
7
@@ -13,27 +13,17 @@ enhancement), and Vimeo (div & progressive enhancement).
13
13
## Installation
14
14
15
15
``` bash
16
- yarn add vue-plyr # or npm i vue-plyr
16
+ yarn add vue-plyr plyr # or npm i vue-plyr plyr
17
17
```
18
18
19
- ### Browser
20
-
21
- Just include Vue, the script file, and the css. e.g.:
22
-
23
- ``` html
24
- <script type =" text/javascript" src =" https://unpkg.com/vue" ></script >
25
- <script type =" text/javascript" src =" https://unpkg.com/vue-plyr/dist/vue-plyr.js" ></script >
26
- <link rel =" stylesheet" href =" https://unpkg.com/vue-plyr/dist/vue-plyr.css" >
27
- ```
28
19
### Module
29
20
30
21
``` js
31
22
// In your main vue file - the one where you create the initial vue instance.
32
23
import Vue from ' vue'
33
24
import VuePlyr from ' vue-plyr'
34
- import ' vue-plyr/dist/vue-plyr.css' // only if your build system can import css, otherwise import it wherever you would import your css.
35
25
36
- // Second argument with defaults can be omitted
26
+ // The second argument is the default config values which can be omitted.
37
27
Vue .use (VuePlyr, {
38
28
plyr: {
39
29
fullscreen: { enabled: false }
@@ -105,21 +95,16 @@ method is to access the player through the `refs` attribute.
105
95
<vue-plyr ref =" plyr" ></vue-plyr >
106
96
</template >
107
97
<script >
108
- name : ' Component' ,
98
+ ' Component' ,
109
99
mounted () {
110
100
console .log (this .player )
111
101
},
112
- computed : {
102
+ {
113
103
player () { return this .$refs .plyr .player }
114
104
}
115
105
</script >
116
106
```
117
107
118
- You are also able to access it through the ` @player ` event ** (soon to be
119
- removed)** which is emitted when the component is mounted. The payload
120
- is the player object. You can use this to manipulate the instance
121
- directly.
122
-
123
108
## Events
124
109
125
110
If you want to capture events from the plyr instance, there are a few
@@ -136,17 +121,17 @@ Valid events are [here](https://github.com/sampotts/plyr#events).
136
121
<vue-plyr ref =" plyr" ></vue-plyr >
137
122
</template >
138
123
<script >
139
- name : ' Component' ,
124
+ ' Component' ,
140
125
mounted () {
141
126
this .player .on (' event' , () => console .log (' event fired' ))
142
127
},
143
- computed : {
128
+ {
144
129
player () { return this .$refs .plyr .player }
145
130
}
146
131
</script >
147
132
```
148
133
149
- The other way ** (soon to be removed) ** is to just pass an array of the
134
+ The other way is to just pass an array of the
150
135
events you want emitted.
151
136
152
137
``` html
@@ -170,7 +155,7 @@ only the three lines:
170
155
import Vue from ' vue'
171
156
import VuePlyr from ' vue-plyr'
172
157
173
- // Second argument with defaults can be omitted
158
+ // The second argument is the default config values which can be omitted.
174
159
Vue .use (VuePlyr, {
175
160
plyr: {
176
161
fullscreen: { enabled: false }
@@ -188,9 +173,6 @@ The `nuxt.config.js` file should at minimum include this:
188
173
export default {
189
174
plugins: [
190
175
' ~/plugins/vue-plyr'
191
- ],
192
- css: [
193
- ' vue-plyr/dist/vue-plyr.css'
194
176
]
195
177
}
196
178
```
0 commit comments