mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11:20 -08:00
add more files
This commit is contained in:
1 parent
5a59096f9b
commit
19a2636ea9
12 files changed
+350
-169
No files matched your search
+21
-2
@@ -1,5 +1,24 @@
|
||||
import { clamp } from './utils';
|
||||
|
||||
export default class Player {
|
||||
constructor({ option }) {
|
||||
//
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
const { option } = this.art;
|
||||
const { $video } = this.art.refs;
|
||||
$video.controls = false;
|
||||
$video.poster = option.poster;
|
||||
$video.volume = clamp(option.volume, 0, 1);
|
||||
$video.autoplay = option.autoplay;
|
||||
$video.preload = option.preload;
|
||||
|
||||
if (typeof option.url === 'string') {
|
||||
$video.src = option.url;
|
||||
} else if (Array.isArray(option.url)) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user