mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
修复本地视频初始化问题
This commit is contained in:
1 parent
5c067c2c47
commit
6deccca9be
2 files changed
+26
-4
No files matched your search
@@ -5553,12 +5553,15 @@
|
|||||||
getExt = _art$constructor$util.getExt,
|
getExt = _art$constructor$util.getExt,
|
||||||
append = _art$constructor$util.append,
|
append = _art$constructor$util.append,
|
||||||
setStyle = _art$constructor$util.setStyle,
|
setStyle = _art$constructor$util.setStyle,
|
||||||
setStyles = _art$constructor$util.setStyles;
|
setStyles = _art$constructor$util.setStyles,
|
||||||
|
sleep = _art$constructor$util.sleep;
|
||||||
var formats = ['mp4', 'ogg', 'webm'];
|
var formats = ['mp4', 'ogg', 'webm'];
|
||||||
var proxy = art.events.proxy,
|
var proxy = art.events.proxy,
|
||||||
|
option = art.option,
|
||||||
notice = art.notice,
|
notice = art.notice,
|
||||||
i18n = art.i18n,
|
i18n = art.i18n,
|
||||||
template = art.template;
|
template = art.template,
|
||||||
|
player = art.player;
|
||||||
i18nMix$1(i18n);
|
i18nMix$1(i18n);
|
||||||
return {
|
return {
|
||||||
attach: function attach(target) {
|
attach: function attach(target) {
|
||||||
@@ -5583,7 +5586,15 @@
|
|||||||
var ext = getExt(file.name);
|
var ext = getExt(file.name);
|
||||||
|
|
||||||
if (ext && formats.includes(ext)) {
|
if (ext && formats.includes(ext)) {
|
||||||
template.$video.src = URL.createObjectURL(file);
|
var url = URL.createObjectURL(file);
|
||||||
|
player.playbackRateRemove();
|
||||||
|
player.aspectRatioRemove();
|
||||||
|
template.$video.src = url;
|
||||||
|
sleep(100).then(function () {
|
||||||
|
player.seek(0);
|
||||||
|
});
|
||||||
|
option.url = url;
|
||||||
|
art.emit('switch', url);
|
||||||
notice.show(i18n.get('Load local video successfully'));
|
notice.show(i18n.get('Load local video successfully'));
|
||||||
} else {
|
} else {
|
||||||
var tip = "".concat(i18n.get('Only file types are supported'), ": ").concat(formats.toString());
|
var tip = "".concat(i18n.get('Only file types are supported'), ": ").concat(formats.toString());
|
||||||
|
|||||||
@@ -17,15 +17,18 @@ export default function artplayerPluginLocalPreview(art) {
|
|||||||
append,
|
append,
|
||||||
setStyle,
|
setStyle,
|
||||||
setStyles,
|
setStyles,
|
||||||
|
sleep,
|
||||||
} = art.constructor.utils;
|
} = art.constructor.utils;
|
||||||
const formats = ['mp4', 'ogg', 'webm'];
|
const formats = ['mp4', 'ogg', 'webm'];
|
||||||
const {
|
const {
|
||||||
events: {
|
events: {
|
||||||
proxy,
|
proxy,
|
||||||
},
|
},
|
||||||
|
option,
|
||||||
notice,
|
notice,
|
||||||
i18n,
|
i18n,
|
||||||
template,
|
template,
|
||||||
|
player,
|
||||||
} = art;
|
} = art;
|
||||||
i18nMix(i18n);
|
i18nMix(i18n);
|
||||||
|
|
||||||
@@ -49,7 +52,15 @@ export default function artplayerPluginLocalPreview(art) {
|
|||||||
}
|
}
|
||||||
const ext = getExt(file.name);
|
const ext = getExt(file.name);
|
||||||
if (ext && formats.includes(ext)) {
|
if (ext && formats.includes(ext)) {
|
||||||
template.$video.src = URL.createObjectURL(file);
|
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'));
|
notice.show(i18n.get('Load local video successfully'));
|
||||||
} else {
|
} else {
|
||||||
const tip = `${i18n.get('Only file types are supported')}: ${formats.toString()}`;
|
const tip = `${i18n.get('Only file types are supported')}: ${formats.toString()}`;
|
||||||
|
|||||||
Reference in new issue
Block a user