From 62733a437b98b6f2591c7716ee3783dd11e04e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Wed, 20 Nov 2024 18:05:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=8F=E7=A8=8B=E5=BA=8FgetVideoInfo?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E9=A1=B9=E7=9B=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/get-video-info/get-video-info.test.js | 6 ++++- pages/API/get-video-info/get-video-info.uvue | 24 +++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/pages/API/get-video-info/get-video-info.test.js b/pages/API/get-video-info/get-video-info.test.js index d0b3d657..b74fcfa5 100644 --- a/pages/API/get-video-info/get-video-info.test.js +++ b/pages/API/get-video-info/get-video-info.test.js @@ -1,6 +1,10 @@ // uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ describe('API-getVideoInfo', () => { - if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) { + if ( + process.env.uniTestPlatformInfo.startsWith('web') || + process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios') || + process.env.uniTestPlatformInfo.toLowerCase().startsWith('mp') + ) { // web平台在自动化测试场景下API调用失败 it('pass', async () => { expect(1).toBe(1); diff --git a/pages/API/get-video-info/get-video-info.uvue b/pages/API/get-video-info/get-video-info.uvue index 431c9a73..d368b031 100644 --- a/pages/API/get-video-info/get-video-info.uvue +++ b/pages/API/get-video-info/get-video-info.uvue @@ -3,13 +3,6 @@ - - - 获取本地相对路径视频信息 - - - {{relativeVideoInfo}} - 获取本地绝对路径视频信息 @@ -19,7 +12,16 @@ - + + + + + 获取本地相对路径视频信息 + + + {{relativeVideoInfo}} + + @@ -38,7 +40,8 @@ videoInfoForTest: null as UTSJSONObject | null } }, - onReady() { + onReady() { + // #ifndef MP uni.getVideoInfo({ src: this.relativeVideoPath, success: (res) => { @@ -52,7 +55,8 @@ showCancel: false }); } - }); + }); + // #endif }, methods: { chooseVideo() { -- GitLab