diff --git a/multimedia/media/media_js_standard/AVPlayerTestBase.js b/multimedia/media/media_js_standard/AVPlayerTestBase.js index 8292a7bfbd4f543afcdf108b18fe08fc745f496c..5d9b873a019a4feabc186d7f782b15f6fe5479d3 100644 --- a/multimedia/media/media_js_standard/AVPlayerTestBase.js +++ b/multimedia/media/media_js_standard/AVPlayerTestBase.js @@ -2166,9 +2166,9 @@ export async function testAVPlayerFun(src, avPlayer, playTest, playTime, done) { console.info(`case media source: ${src}`) await media.createAVPlayer().then((video) => { if (typeof(video) != 'undefined') { + expect(avPlayer.state).assertEqual('idle'); console.info('case createAVPlayer success'); avPlayer = video; - expect(avPlayer.state).assertEqual('idle'); } else { console.error('case createAVPlayer failed'); expect().assertFail(); diff --git a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js index 1c7745b998053aeb7bde9c48a6acc42c8dfe3fdf..620dcfb02bfe798b4e12f1be9dff39cc26b90e1c 100644 --- a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js +++ b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js @@ -136,9 +136,9 @@ export default function AVPlayerLocalTest() { media.createAVPlayer((err, video) => { console.info(`case media err: ${err}`) if (typeof (video) != 'undefined') { + expect(avPlayer.state).assertEqual('idle'); console.info('case createAVPlayer success'); avPlayer = video; - expect(avPlayer.state).assertEqual('idle'); setAVPlayerTrackCb(avPlayer, descriptionKey, descriptionValue, done) setSource(avPlayer, src); }