From 1809f1b751c1c30274502cf1224ea3a8bab46c7a Mon Sep 17 00:00:00 2001 From: dongxinli Date: Tue, 18 Jul 2023 19:55:33 +0800 Subject: [PATCH] =?UTF-8?q?recorder=20=E6=B8=85=E6=A5=9A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dongxinli --- .../media/media_js_standard/audioRecorder/Test.json | 3 +++ .../src/main/ets/test/AVPlayerMultiTrackTest.test.js | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/multimedia/media/media_js_standard/audioRecorder/Test.json b/multimedia/media/media_js_standard/audioRecorder/Test.json index f960aa386..82a7b262a 100644 --- a/multimedia/media/media_js_standard/audioRecorder/Test.json +++ b/multimedia/media/media_js_standard/audioRecorder/Test.json @@ -14,6 +14,9 @@ "run-command": [ "rm -rf /storage/media/100/local/files/Audios/audio_*", "rm -rf /storage/media/100/local/files/Videos/audio_*", + "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", + "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", + "sleep 5", "param set persist.ace.testmode.enabled 1", "power-shell wakeup", "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", diff --git a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerMultiTrackTest.test.js b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerMultiTrackTest.test.js index f567354e7..5f2b1da08 100644 --- a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerMultiTrackTest.test.js +++ b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerMultiTrackTest.test.js @@ -100,10 +100,14 @@ export default function AVPlayerMultiTrackTest() { } async function getCurrentAudioTrack() { - await avPlayer.getCurrentTrack(0).then((index) => { - console.info(`case current audio track index is ${index}`); - currentTrack = index; - }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); + await avPlayer.getCurrentTrack(0, (err, index) => { + if (err == null) { + console.info(`case current audio track index is ${index}`); + trackIndex = index; + } else { + console.error('getCurrentTrack failed and error is ' + err.message); + } + }); } async function changeAudioTrack() { -- GitLab