删除多余事件

This commit is contained in:
Harvey committed 2019-11-28 10:10:29 +08:00
1 parent e0faa3fe68
commit 7ff61b4660
38 files changed
+266 -516

No files matched your search

+9 -4
View File
@@ -3,9 +3,10 @@ import { clamp } from '../utils';
export default function attrInit(art, player) {
const {
option,
storage,
template: { $video },
} = art;
Object.keys(option.moreVideoAttr).forEach(key => {
$video[key] = option.moreVideoAttr[key];
});
@@ -13,11 +14,16 @@ export default function attrInit(art, player) {
if (option.muted) {
$video.muted = option.muted;
}
if (option.volume) {
$video.volume = clamp(option.volume, 0, 1);
}
const volume = storage.get('volume');
if (volume) {
$video.volume = clamp(volume, 0, 1);
}
if (option.poster) {
$video.poster = option.poster;
}
@@ -27,6 +33,5 @@ export default function attrInit(art, player) {
}
$video.controls = false;
player.attachUrl(option.url);
player.url = option.url;
}