From 63f0c02938314f8fd5d8254301061f6fbdc635c4 Mon Sep 17 00:00:00 2001 From: lwx1121892 Date: Thu, 3 Nov 2022 14:18:48 +0800 Subject: [PATCH] modify ContentType Signed-off-by: lwx1121892 --- .../src/main/js/test/AudioInterrupt.test.js | 4 +- .../entry/src/main/ets/MainAbility/app.ets | 38 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js b/multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js index 9620b29fa..880ec9d59 100644 --- a/multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js +++ b/multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js @@ -92,8 +92,8 @@ describe('audioInterrupt', function () { } var AudioRendererInfo = { - content: audio.ContentType.CONTENT_TYPE_RINGTONE, - usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, + content: audio.ContentType.CONTENT_TYPE_MUSIC, + usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } diff --git a/multimedia/audio/audio_js_standard/audioInterruptRender/entry/src/main/ets/MainAbility/app.ets b/multimedia/audio/audio_js_standard/audioInterruptRender/entry/src/main/ets/MainAbility/app.ets index 509cdd3cc..366bfaa55 100644 --- a/multimedia/audio/audio_js_standard/audioInterruptRender/entry/src/main/ets/MainAbility/app.ets +++ b/multimedia/audio/audio_js_standard/audioInterruptRender/entry/src/main/ets/MainAbility/app.ets @@ -10,7 +10,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License.info(TAG + + * limitations under the License. */ import audio from '@ohos.multimedia.audio'; import fileio from '@ohos.fileio'; @@ -137,26 +137,26 @@ export default { }); console.info(TAG + 'AudioFrameworkRenderLog: Renderer after read'); await sleep(3000); - // await audioRen.drain().then(async function () { - console.info(TAG + 'AudioFrameworkRenderLog: Renderer drained : SUCCESS'); - let wantInfo = { - want: - { - bundleName: "com.example.audiorenderinterrupt", - abilityName: "com.example.entry.MainAbility" - }, - resultCode: 1111 - } - featureAbility.terminateSelfWithResult(wantInfo).then(() => { - console.info(TAG + 'terminateSelf ================================== success') - }) - .catch(() => { - console.info(TAG + 'terminateSelf ==================================== fail') + await audioRen.drain().then(async function () { + console.info(TAG + 'AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + let wantInfo = { + want: + { + bundleName: "com.example.audiorenderinterrupt", + abilityName: "com.example.entry.MainAbility" + }, + resultCode: 1111 + } + featureAbility.terminateSelfWithResult(wantInfo).then(() => { + console.info(TAG + 'terminateSelf ================================== success') }) + .catch(() => { + console.info(TAG + 'terminateSelf ==================================== fail') + }) - // }).catch((err) => { - // console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); - // }); + }).catch((err) => { + console.error(TAG + 'AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + }); }, onDestroy() { console.log(TAG1 + 'onDestroy'); -- GitLab