You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2022/02/22 03:04:31 UTC
[echarts-bar-racing] branch master updated: cancel video exporting
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-bar-racing.git
The following commit(s) were added to refs/heads/master by this push:
new ca77d80 cancel video exporting
ca77d80 is described below
commit ca77d805f91a5f1437695d988cec1d15f252e0ad
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Feb 22 11:04:25 2022 +0800
cancel video exporting
---
src/components/BChart.vue | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/components/BChart.vue b/src/components/BChart.vue
index b63f0b1..11d86a7 100644
--- a/src/components/BChart.vue
+++ b/src/components/BChart.vue
@@ -97,7 +97,16 @@ export default defineComponent({
const title = this.title || this.$t('toolName') || 'bar-racing';
await this.doRun();
+ // Canceld
+ if (!this.isExportingVideo) {
+ return;
+ }
const webMBlob = await recorder.complete()
+ // Canceld
+ if (!this.isExportingVideo) {
+ return;
+ }
+
const url = URL.createObjectURL(webMBlob);
const link = document.createElement('a');
link.download = title;
@@ -110,6 +119,7 @@ export default defineComponent({
timeline.stopMock();
this.isExportingVideo = false;
+ return true;
}
catch (e) {
// Reset
@@ -119,7 +129,7 @@ export default defineComponent({
console.error(e);
await wait(50);
this.run();
- return false;
+ return;
}
},
@@ -243,6 +253,10 @@ export default defineComponent({
}
for (let i = 0; i < dataCnt; ++i) {
+ // Cancled.
+ if (!this.isExportingVideo) {
+ return;
+ }
const row = that.chartData[headerLength + i + 1] as string[];
await step(row);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org