diff --git a/pages/API/choose-video/choose-video.uvue b/pages/API/choose-video/choose-video.uvue
index d265d7b1b22b45ccf6df497a50c1eadcb313d7fc..f4948efc7a85894e3f7daad550046179d4d74812 100644
--- a/pages/API/choose-video/choose-video.uvue
+++ b/pages/API/choose-video/choose-video.uvue
@@ -5,6 +5,10 @@
+
+ 视频信息
+
+ {{videoInfo}}
@@ -12,9 +16,11 @@
+
+
@@ -34,20 +40,23 @@
sourceType: ["album", "camera"],
compressed: true,
maxDuration: 60,
- camera: "back"
+ camera: "back",
+ videoInfo: ""
}
},
methods: {
chooseVideo() {
uni.chooseVideo({
sourceType: this.sourceType,
+ // #ifdef APP
compressed: this.compressed,
+ // #endif
maxDuration: this.maxDuration,
camera: this.camera,
- // extension: ['mp4'],
success: (res) => {
console.log("chooseVideo success", JSON.stringify(res));
this.src = res.tempFilePath;
+ this.videoInfo = `视频长度: ${res.duration}s\n视频大小: ${Math.ceil(res.size / 1024)}KB\n视频宽度: ${res.width}\n视频高度: ${res.height}\n`;
},
fail: (err) => {
uni.showModal({
@@ -56,7 +65,7 @@
showCancel: false
});
}
- })
+ });
},
onSourceTypeChange(value : number) {
this.sourceType = this.sourceTypeItems[value];
diff --git a/pages/API/compress-video/compress-video.uvue b/pages/API/compress-video/compress-video.uvue
index 2069049b2d1a3a17678587eb318f2e2f750f5c3a..fb3440655067b6a300ee8bae723aa02cefcf990b 100644
--- a/pages/API/compress-video/compress-video.uvue
+++ b/pages/API/compress-video/compress-video.uvue
@@ -21,9 +21,11 @@
+
+ 相对于原视频的分辨率比例,取值范围(0, 1]
+
+
-
@@ -107,8 +109,8 @@
onQualityChange(value : number) {
this.quality = this.qualityItems[value];
},
- onResolutionConfirm(value : string) {
- this.resolution = parseFloat(value);
+ onResolutionChange(event : UniSliderChangeEvent) {
+ this.resolution = event.detail.value;
}
}
}