mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 18:41:20 -08:00
添加字幕插件
This commit is contained in:
1 parent
5f384fb04d
commit
1667457188
24 files changed
+492
-247
No files matched your search
@@ -0,0 +1,51 @@
|
||||
# artplayer-plugin-subtitle
|
||||
|
||||
Subtitle plugin for ArtPlayer
|
||||
|
||||
## Install
|
||||
|
||||
Install with `npm`
|
||||
|
||||
```
|
||||
$ npm install artplayer-plugin-subtitle
|
||||
```
|
||||
|
||||
Or install with `yarn`
|
||||
|
||||
```
|
||||
$ yarn add artplayer-plugin-subtitle
|
||||
```
|
||||
|
||||
```js
|
||||
import artplayerPluginSubtitle from 'artplayer-plugin-subtitle';
|
||||
```
|
||||
|
||||
Or umd builds are also available
|
||||
|
||||
```html
|
||||
<script src="path/to/artplayer-plugin-subtitle.js"></script>
|
||||
```
|
||||
|
||||
Will expose the global variable to `window.artplayerPluginSubtitle`.
|
||||
|
||||
## Usage
|
||||
|
||||
```html
|
||||
<div class="artplayer-app"></div>
|
||||
```
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: 'path/to/video.mp4',
|
||||
plugins: [
|
||||
artplayerPluginSubtitle({
|
||||
time: -1, // Subtitle delay time, ranging from -10 to 10
|
||||
}),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Harvey Zack](https://www.zhw-island.com/)
|
||||
Reference in new issue
Block a user