add more files

This commit is contained in:
Harvey Zack committed 2018-10-12 11:57:51 +08:00
1 parent 5a59096f9b
commit 19a2636ea9
12 files changed
+350 -169

No files matched your search

+21 -2
View File
@@ -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)) {
//
}
}
}