mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 10:31:20 -08:00
压缩字符
This commit is contained in:
1 parent
2df60a78ff
commit
5f40463713
40 files changed
+385
-481
No files matched your search
@@ -69,9 +69,9 @@ function artplayerPluginGif(art) {
|
||||
cleanTimer();
|
||||
const pressTime = new Date() - pressStartTime;
|
||||
if (isProcessing) {
|
||||
notice.show(i18n.get('There is another gif in the processing'));
|
||||
notice.show = i18n.get('There is another gif in the processing');
|
||||
} else if (pressTime < 1000) {
|
||||
notice.show(i18n.get('Gif time is too short'));
|
||||
notice.show = i18n.get('Gif time is too short');
|
||||
} else {
|
||||
const numFrames = Math.floor(clamp(pressTime, 1000, timeLimit) / 100);
|
||||
const { videoWidth, videoHeight } = $video;
|
||||
@@ -97,7 +97,7 @@ function artplayerPluginGif(art) {
|
||||
cleanTimer();
|
||||
offset = player.currentTime;
|
||||
pressStartTime = new Date();
|
||||
notice.show(i18n.get('Long press, gif length is between 1 second and 10 seconds'));
|
||||
notice.show = i18n.get('Long press, gif length is between 1 second and 10 seconds');
|
||||
(function loop() {
|
||||
progressTimer = setTimeout(() => {
|
||||
const width = parseInt($progress.style.width, 10);
|
||||
@@ -105,7 +105,7 @@ function artplayerPluginGif(art) {
|
||||
$progress.style.width = `${width + 1}%`;
|
||||
loop();
|
||||
} else {
|
||||
notice.show(i18n.get('Release the mouse to start'));
|
||||
notice.show = i18n.get('Release the mouse to start');
|
||||
}
|
||||
}, timeLimit / 100);
|
||||
})();
|
||||
@@ -123,7 +123,7 @@ function artplayerPluginGif(art) {
|
||||
isProcessing = true;
|
||||
loading.show = true;
|
||||
art.emit('artplayerPluginGif:start');
|
||||
notice.show(i18n.get('Start creating gif...'), false);
|
||||
notice.show = i18n.get('Start creating gif...');
|
||||
gifshot.createGIF(
|
||||
{
|
||||
...config,
|
||||
@@ -132,13 +132,13 @@ function artplayerPluginGif(art) {
|
||||
},
|
||||
obj => {
|
||||
if (obj.error) {
|
||||
notice.show(obj.errorMsg);
|
||||
notice.show = obj.errorMsg;
|
||||
errorHandle(false, obj.errorMsg);
|
||||
} else if (typeof callback === 'function') {
|
||||
const base64String = obj.image.split(',')[1];
|
||||
const blob = b64toBlob(base64String, 'image/gif');
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
notice.show(i18n.get('Create gif successfully'));
|
||||
notice.show = i18n.get('Create gif successfully');
|
||||
art.emit('artplayerPluginGif', blobUrl);
|
||||
callback(blobUrl);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user