格式化

This commit is contained in:
Harvey Zack committed 2018-11-21 19:45:44 +08:00
1 parent 0454f785be
commit 203ad0d3a0
75 files changed
+3120 -2904

No files matched your search

+20 -17
View File
@@ -1,25 +1,28 @@
import { clamp, sleep } from '../utils';
export default function attrInit(art, player) {
const { option, refs: { $video } } = art;
Object.keys(option.moreVideoAttr).forEach(key => {
$video[key] = option.moreVideoAttr[key];
});
const {
option,
refs: { $video },
} = art;
Object.keys(option.moreVideoAttr).forEach(key => {
$video[key] = option.moreVideoAttr[key];
});
if (option.volume) {
$video.volume = clamp(option.volume, 0, 1);
}
if (option.volume) {
$video.volume = clamp(option.volume, 0, 1);
}
if (option.poster) {
$video.poster = option.poster;
}
if (option.poster) {
$video.poster = option.poster;
}
if (option.autoplay) {
$video.autoplay = option.autoplay;
}
if (option.autoplay) {
$video.autoplay = option.autoplay;
}
sleep().then(() => {
art.emit('beforeMountUrl', option.url);
$video.src = player.mountUrl(option.url);
});
sleep().then(() => {
art.emit('beforeMountUrl', option.url);
$video.src = player.mountUrl(option.url);
});
}