mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51:20 -08:00
删除多余事件
This commit is contained in:
1 parent
e0faa3fe68
commit
7ff61b4660
38 files changed
+266
-516
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user