mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 03:11:20 -08:00
typofix
This commit is contained in:
1 parent
6deccca9be
commit
3e429add87
2 files changed
+36
-41
No files matched your search
@@ -34,7 +34,6 @@ export default function artplayerPluginLocalPreview(art) {
|
||||
|
||||
return {
|
||||
attach(target) {
|
||||
console.log(target);
|
||||
const $input = append(target, '<input type="file">');
|
||||
setStyle(target, 'position', 'relative');
|
||||
setStyles($input, {
|
||||
@@ -47,25 +46,24 @@ export default function artplayerPluginLocalPreview(art) {
|
||||
});
|
||||
proxy($input, 'change', () => {
|
||||
const file = $input.files[0];
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
const ext = getExt(file.name);
|
||||
if (ext && formats.includes(ext)) {
|
||||
const url = URL.createObjectURL(file);
|
||||
player.playbackRateRemove();
|
||||
player.aspectRatioRemove();
|
||||
template.$video.src = url;
|
||||
sleep(100).then(() => {
|
||||
player.seek(0);
|
||||
});
|
||||
option.url = url;
|
||||
art.emit('switch', url);
|
||||
notice.show(i18n.get('Load local video successfully'));
|
||||
} else {
|
||||
const tip = `${i18n.get('Only file types are supported')}: ${formats.toString()}`;
|
||||
notice.show(tip, true, 3000);
|
||||
console.warn(tip);
|
||||
if (file) {
|
||||
const ext = getExt(file.name);
|
||||
if (ext && formats.includes(ext)) {
|
||||
const url = URL.createObjectURL(file);
|
||||
player.playbackRateRemove();
|
||||
player.aspectRatioRemove();
|
||||
template.$video.src = url;
|
||||
sleep(100).then(() => {
|
||||
player.seek(0);
|
||||
});
|
||||
option.url = url;
|
||||
art.emit('switch', url);
|
||||
notice.show(i18n.get('Load local video successfully'));
|
||||
} else {
|
||||
const tip = `${i18n.get('Only file types are supported')}: ${formats.toString()}`;
|
||||
notice.show(tip, true, 3000);
|
||||
console.warn(tip);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user