23 | ```
24 |
25 | ``` vue
26 | import VueCoreVideoPlayer from 'vue-core-video-player'
27 |
28 | Vue.use(VueCoreVideoPlayer)
29 | ```
30 |
31 | ## Basic Configuration
32 |
33 | #### The video source
34 |
35 | Use `src` property to set the video source of your player. It must be the only three types below.
36 |
37 | + String; It can be relative path of your video file or some cdn url.
38 |
39 | ``` html
40 |
41 | ```
42 | + Array; It means you set different resolution of the same video source; Our default resolution is `720p`;
43 |
44 | And you must set two keys (`resolution`, `src`) of your array item.
45 |
46 | ``` js
47 | const videoSource = [
48 | {
49 | src: 'https://media.vued.vanthink.cn/sparkle_your_name_am360p.mp4',
50 | resolution: '360p',
51 | }, {
52 | src: 'https://media.vued.vanthink.cn/sparkle_your_name_am720p.mp4',
53 | resolution: '720p',
54 | }, {
55 | src: 'https://media.vued.vanthink.cn/y2mate.com%20-%20sparkle_your_name_amv_K_7To_y9IAM_1080p.mp4',
56 | resolution: '1080p'
57 | }
58 | ]
59 | ```
60 | If you want to play different file type in different browser. You can add `type` property in an array;
61 |
62 | ``` bash
63 | const videoSource = [
64 | {
65 | src: 'https://media.vued.vanthink.cn/sparkle_your_name_am720p.webm',
66 | type: 'video/webm',
67 | }, {
68 | src: 'https://media.vued.vanthink.cn/sparkle_your_name_am720p.mp4',
69 | type: 'video/mp4',
70 | }
71 | ]
72 | ```
73 |
74 | [caniuse-video-format](https://caniuse.com/#search=video%20format) show which browser supports the specify video file.
75 |
76 |
77 | ### Controls
78 |
79 | `controls` is set for player bottom dashboard.
80 |
81 | + String;
82 |
83 | + 'fixed' indicates the bottom dashboard is still visible to users.
84 | + 'auto' indicates the bottom dashboard will hide when there is no interaction between user and player.
85 |
86 | + Boolean;
87 | + `false` indicates that player will hide the bottom dashboard
88 | + `true` indicates that player will show the bottom dashboard and work like the `'auto'` value above;
89 |
90 |
91 | ### Autoplay
92 |
93 | If you set `autoplay`, the player will try to play video. Different browser has different policies to handle auto play action. If player failed, it will show the play button for user to touch.
94 |
95 | ### Video Playback control
96 |
97 | And it keep the same attributes of [HTML Video](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video).
98 |
99 | | Props | Type | Example | Description |
100 | | ------------- |:-------------:|:----- |:--------------|
101 | | volume | number | `0.5` | the volume of video (0-1) |
102 | | muted | boolean | `true` | if set `true`, the video will be muted |
103 | | cover | string | `'./cover.png'` | it will show the cover of the video; If you set `autoplay`, the player auto play successfully, the `cover` property will not work. |
104 | | title | string | `'your title'` | it will show the title of video for better SEO |
105 | | logo | string | `'./logo.png'` | it will show the your logo of the player |
106 | | loop | boolean | `true` | it will automatically seek back to the start upon reaching the end of the video |
107 | | [preload](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) | string | `'metadata'` | `'none'` means not preload video source; `'metadata'` indicates that only video metadata (e.g. length) is fetched |
108 |
109 |
110 | ### i18n
111 |
112 | You can use your own language [json](https://github.com/core-player/vue-core-video-player/blob/dev/src/lang/en.json) data to replace all the player text. We provide three language file reference [here](https://github.com/core-player/vue-core-video-player/tree/dev/src/lang).
113 |
114 | + [en: English](https://github.com/core-player/vue-core-video-player/blob/dev/src/lang/en.json)
115 | + [zh-CN: 简体中文](https://github.com/core-player/vue-core-video-player/blob/dev/src/lang/zh-cn.json)
116 | + [jp: 日本語](https://github.com/core-player/vue-core-video-player/blob/dev/src/lang/jp.json)
117 |
118 |
119 | ``` js
120 | import VueCoreVideoPlayer from 'vue-core-video-player'
121 |
122 | Vue.use(VueCoreVideoPlayer, {
123 | lang: 'zh-CN'
124 | })
125 | ```
126 |
127 | Use custom language data:
128 |
129 | ``` bash
130 | import VueCoreVideoPlayer from 'vue-core-video-player'
131 |
132 | const kr = {
133 | ...
134 | "dashboard" : {
135 | "btn": {
136 | ....
137 | "pause": "일시적인",
138 | "fullscreen": "전체화면",
139 | "exitFullscreen": "전체 화면 종료",
140 | },
141 | }
142 |
143 |
144 | Vue.use(VueCoreVideoPlayer, {
145 | lang: kr
146 | })
147 |
148 | ```
--------------------------------------------------------------------------------
/docs/jp/README.md:
--------------------------------------------------------------------------------
1 | # vue-core-video-player
2 |
3 |
4 | ちょっと待って ...
5 |
--------------------------------------------------------------------------------
/docs/zh-CN/README.md:
--------------------------------------------------------------------------------
1 | # vue-core-video-player
2 |
3 | ## 快速开始
4 |
5 | ### 安装
6 |
7 | ``` bash
8 | $ npm install --save vue-core-video-player
9 | ```
10 |
11 | 当然,你也可以使用 CDN 内联
12 |
13 | ``` html
14 |
15 | ```
16 |
17 | ### 添加播放源
18 |
19 | ``` vue
20 |