Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cbea9d05
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cbea9d05
编写于
3月 18, 2023
作者:
1
15754133731
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<媒体用例新增>
Signed-off-by:
N
15754133731
<
chenjiahuan@huawei.com
>
上级
e553ea39
变更
29
展开全部
隐藏空白更改
内联
并排
Showing
29 changed file
with
5347 addition
and
0 deletion
+5347
-0
multimedia/BUILD.gn
multimedia/BUILD.gn
+1
-0
multimedia/media/media_js_standard/AVPlayerTestBase.js
multimedia/media/media_js_standard/AVPlayerTestBase.js
+2342
-0
multimedia/media/media_js_standard/avPlayer/AppScope/app.json
...imedia/media/media_js_standard/avPlayer/AppScope/app.json
+21
-0
multimedia/media/media_js_standard/avPlayer/AppScope/resources/base/element/string.json
...dard/avPlayer/AppScope/resources/base/element/string.json
+8
-0
multimedia/media/media_js_standard/avPlayer/AppScope/resources/base/media/app_icon.png
...ndard/avPlayer/AppScope/resources/base/media/app_icon.png
+0
-0
multimedia/media/media_js_standard/avPlayer/BUILD.gn
multimedia/media/media_js_standard/avPlayer/BUILD.gn
+43
-0
multimedia/media/media_js_standard/avPlayer/Test.json
multimedia/media/media_js_standard/avPlayer/Test.json
+88
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/Application/AbilityStage.ts
...d/avPlayer/entry/src/main/ets/Application/AbilityStage.ts
+23
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/MainAbility.ts
...rd/avPlayer/entry/src/main/ets/MainAbility/MainAbility.ts
+52
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/pages/index/index.ets
...ayer/entry/src/main/ets/MainAbility/pages/index/index.ets
+51
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/pages/second/second.ets
...er/entry/src/main/ets/MainAbility/pages/second/second.ets
+43
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/TestAbility/TestAbility.ts
...rd/avPlayer/entry/src/main/ets/TestAbility/TestAbility.ts
+50
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/TestAbility/pages/index.ets
...d/avPlayer/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...er/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHlsFuncTest.test.js
...layer/entry/src/main/ets/test/AVPlayerHlsFuncTest.test.js
+227
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpCompatibilityTest.test.ets
.../src/main/ets/test/AVPlayerHttpCompatibilityTest.test.ets
+124
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpSeekTest.test.ets
...yer/entry/src/main/ets/test/AVPlayerHttpSeekTest.test.ets
+124
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js
...vPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js
+548
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerStabilityTest.test.js
...yer/entry/src/main/ets/test/AVPlayerStabilityTest.test.js
+1241
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AvPlayerEnumTest.test.js
...avPlayer/entry/src/main/ets/test/AvPlayerEnumTest.test.js
+106
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/List.test.ets
...s_standard/avPlayer/entry/src/main/ets/test/List.test.ets
+29
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/module.json
...dia/media_js_standard/avPlayer/entry/src/main/module.json
+56
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/base/element/string.json
...vPlayer/entry/src/main/resources/base/element/string.json
+32
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/base/media/icon.png
...ard/avPlayer/entry/src/main/resources/base/media/icon.png
+0
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/base/profile/main_pages.json
...yer/entry/src/main/resources/base/profile/main_pages.json
+6
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/rawfile/01.mp3
...standard/avPlayer/entry/src/main/resources/rawfile/01.mp3
+0
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/rawfile/H264_AAC.mp4
...rd/avPlayer/entry/src/main/resources/rawfile/H264_AAC.mp4
+3
-0
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/rawfile/H264_NONE.mp4
...d/avPlayer/entry/src/main/resources/rawfile/H264_NONE.mp4
+3
-0
multimedia/media/media_js_standard/avPlayer/signature/openharmony_sx.p7b
...a/media_js_standard/avPlayer/signature/openharmony_sx.p7b
+0
-0
未找到文件。
multimedia/BUILD.gn
浏览文件 @
cbea9d05
...
...
@@ -46,6 +46,7 @@ group("multimedia") {
"media/media_js_standard/audioPlayer:audio_player_js_hap",
"media/media_js_standard/audioRecorder:audio_recorder_js_hap",
"media/media_js_standard/avRecorder:av_recorder_js_hap",
"media/media_js_standard/avPlayer:avplayer_js_hap",
"media/media_js_standard/recorderFormat:recorder_format_js_hap",
"media/media_js_standard/videoPlayer:video_player_js_hap",
"medialibrary/mediaLibrary_album:mediaLibrary_album_hap",
...
...
multimedia/media/media_js_standard/AVPlayerTestBase.js
0 → 100644
浏览文件 @
cbea9d05
此差异已折叠。
点击以展开。
multimedia/media/media_js_standard/avPlayer/AppScope/app.json
0 → 100644
浏览文件 @
cbea9d05
{
"app"
:{
"bundleName"
:
"ohos.acts.multimedia.avplayer"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
multimedia/media/media_js_standard/avPlayer/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
cbea9d05
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
cbea9d05
15.1 KB
multimedia/media/media_js_standard/avPlayer/BUILD.gn
0 → 100644
浏览文件 @
cbea9d05
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("avplayer_js_hap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":ActsAVPlayerTest_js_assets",
":ActsAVPlayerTest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAVPlayerTest"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("ActsAVPlayerTest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ActsAVPlayerTest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("ActsAVPlayerTest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":ActsAVPlayerTest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
multimedia/media/media_js_standard/avPlayer/Test.json
0 → 100644
浏览文件 @
cbea9d05
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"bundle-name"
:
"ohos.acts.multimedia.avplayer"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"5000000"
,
"testcase-timeout"
:
800000
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAVPlayerTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"remount"
,
"mkdir /data/test"
,
"mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files"
,
"chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone"
]
},
{
"type"
:
"PushKit"
,
"push"
:
[
"ActsAVPlayerTest.hap->/data/test/ActsAVPlayerTest.hap"
,
"./resource/audio/H264_AAC.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mp4/h264_mp3_128x96_30r.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/h263_aac.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/h263_mp3.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/MPEG2_AAC.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/MPEG2_MP3.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/h264_1280x720_30.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/H263.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/MPEG2.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mpeg_ts/h264_aac_480p_25r.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mpeg_ts/h264_mp3_480p_25r.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/H263_AAC.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/H263_MP3.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mpeg_ts/mpeg2_aac_720p_30r.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mpeg_ts/mpeg2_mp3_480p_25r.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mpeg_ts/mpeg4_aac_720p_30r.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mpeg_ts/mpeg4_mp3_480p_25r.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/h264_320x240_60.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/h263_1408x1152_30.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/MPEG2.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/mpeg4_320x240_60.ts -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/webm/vp8_vorbis_480p_25r.webm -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/vp8_720x480_60.webm -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/H264_AAC.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/H264_MP3.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mkv/h263_aac_640x480_30r.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mkv/h263_mp3_176x144_25r.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/MPEG2_AAC.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/MPEG2_MP3.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/videoplayer/mkv/mpeg4_aac_720p_30r.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/MPEG4_MP3.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/h264_320x240_30.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/h263_1408x1152_60.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/MPEG2.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/mpeg4_320x240_60.mkv -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AAC_48000_32_1.aac -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/audio/01.mp3 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/audio/56.m4a -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/OGG_48000_1.ogg -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/vorbis_48000_32_1.wav -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/audioplayer/flac/flac_48ksr_16kbr_1ch.flac -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/hevc_320x240_60.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/H264_MP3_1s.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
,
"./resource/media/AVPlayer/h264_aac_3840_2160.mp4 -> /data/app/el2/100/base/ohos.acts.multimedia.avplayer/haps/phone/files/"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"chmod 644 /data/test/*.hap"
,
"scanner"
,
"param set persist.ace.testmode.enabled 1"
,
"setenforce 0"
]
}
]
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
context
=
this
.
context
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate windowStage=
"
+
windowStage
)
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/pages/index/index.ets
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from "../../../test/List.test.ets"
var mXComponentController: XComponentController = new XComponentController()
var surfaceId: any
@Entry
@Component
struct Index {
aboutToAppear() {
console.info("start run testcase!!!!");
}
build() {
Flex() {
XComponent({
id: 'xcomponent',
type: 'surface',
libraryname: '',
controller: mXComponentController
})
.onLoad(() => {
console.info('CameraModuleTest: OnLoad() is called!')
mXComponentController.setXComponentSurfaceSize({ surfaceWidth: 1920, surfaceHeight: 1080 });
surfaceId = mXComponentController.getXComponentSurfaceId()
globalThis.value = surfaceId
console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + globalThis.value)
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
})
.width('1920px')
.height('1080px')
}
}
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/pages/second/second.ets
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import
Ability
from
'
@ohos.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
loadContent
(
"
TestAbility/pages/index
"
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to load the content. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in loading the content. Data:
'
+
JSON
.
stringify
(
data
))
});
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a ohos.acts.multimedia.avplayer.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHlsFuncTest.test.js
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import
media
from
'
@ohos.multimedia.media
'
import
*
as
mediaTestBase
from
'
../../../../../../MediaTestBase
'
;
import
*
as
AVPlayerTestBase
from
'
../../../../../../AVPlayerTestBase.js
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
;
export
default
function
AVPlayerHlsFuncTest
()
{
describe
(
'
AVPlayerHlsFuncTest
'
,
function
()
{
const
HTTP_PATH
=
'
http://xxx.xx.xx.xx:xxxx/
'
;
const
PLAY_TIME
=
3000
;
let
avPlayer
=
null
;
let
expectBitrateArray
=
[];
let
videoSizeArray
=
[];
let
videoSizeId
=
-
1
;
let
bitrateArray
=
[];
let
setBitrateState
=
''
;
let
surfaceID
=
globalThis
.
value
;
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
beforeEach
(
async
function
()
{
console
.
info
(
'
beforeEach case
'
);
})
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
})
afterAll
(
async
function
()
{
console
.
info
(
'
afterAll case
'
);
if
(
avPlayer
!=
null
)
{
avPlayer
.
release
().
then
(()
=>
{
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
}
})
function
checkArray
(
realArray
,
expectArray
)
{
expect
(
realArray
.
length
).
assertEqual
(
expectArray
.
length
);
for
(
let
i
=
0
;
i
<
expectArray
.
length
;
i
++
)
{
console
.
info
(
'
case expect
'
+
expectArray
[
i
]);
expect
(
realArray
[
i
]).
assertEqual
(
expectArray
[
i
]);
}
}
async
function
initAVPlayer
(
src
,
done
)
{
let
availableBitratesCnt
=
0
;
let
bitrateDoneCnt
=
0
;
await
media
.
createAVPlayer
().
then
((
video
)
=>
{
if
(
typeof
(
video
)
!=
'
undefined
'
)
{
console
.
info
(
'
case createAVPlayer success
'
);
avPlayer
=
video
;
}
else
{
console
.
error
(
'
case createAVPlayer failed
'
);
expect
().
assertFail
();
done
();
}
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
avPlayer
.
on
(
'
stateChange
'
,
async
(
state
,
reason
)
=>
{
console
.
info
(
`case stateChange called, state is
${
state
}
, reason is
${
reason
}
`
);
if
(
reason
==
media
.
StateChangeReason
.
BACKGROUND
&&
state
!=
AVPlayerTestBase
.
AV_PLAYER_STATE
.
COMPLETED
)
{
console
.
info
(
`case media.StateChangeReason.BACKGROUND`
);
await
avPlayer
.
release
().
then
(()
=>
{
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
}
console
.
info
(
`case state is
${
state
}
`
);
if
(
setBitrateState
==
state
)
{
avPlayer
.
setBitrate
(
expectBitrateArray
[
videoSizeId
]);
}
switch
(
state
)
{
case
AVPlayerTestBase
.
AV_PLAYER_STATE
.
IDLE
:
break
;
case
AVPlayerTestBase
.
AV_PLAYER_STATE
.
INITIALIZED
:
console
.
info
(
`case AVPlayerTestBase.AV_PLAYER_STATE.INITIALIZED`
);
expect
(
avPlayer
.
state
).
assertEqual
(
AVPlayerTestBase
.
AV_PLAYER_STATE
.
INITIALIZED
);
avPlayer
.
surfaceId
=
surfaceID
;
avPlayer
.
prepare
().
then
(()
=>
{
console
.
info
(
'
case prepare called
'
);
expect
(
avPlayer
.
state
).
assertEqual
(
AVPlayerTestBase
.
AV_PLAYER_STATE
.
PREPARED
);
expect
(
avPlayer
.
currentTime
).
assertEqual
(
0
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
break
;
case
AVPlayerTestBase
.
AV_PLAYER_STATE
.
PREPARED
:
expect
(
avPlayer
.
state
).
assertEqual
(
AVPlayerTestBase
.
AV_PLAYER_STATE
.
PREPARED
);
expect
(
avPlayer
.
currentTime
).
assertEqual
(
0
)
avPlayer
.
loop
=
true
;
avPlayer
.
play
();
break
;
case
AVPlayerTestBase
.
AV_PLAYER_STATE
.
PAUSED
:
avPlayer
.
play
();
break
;
case
AVPlayerTestBase
.
AV_PLAYER_STATE
.
COMPLETED
:
avPlayer
.
play
();
break
;
case
AVPlayerTestBase
.
AV_PLAYER_STATE
.
RELEASED
:
expect
(
availableBitratesCnt
).
assertLarger
(
0
);
avPlayer
=
null
;
done
();
break
;
case
AVPlayerTestBase
.
AV_PLAYER_STATE
.
ERROR
:
expect
().
assertFail
();
avPlayer
.
release
().
then
(()
=>
{
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
break
;
default
:
break
;
}
});
avPlayer
.
on
(
'
bitrateDone
'
,
(
bitrate
)
=>
{
console
.
info
(
`case bitrateDone called, bitrate is
${
bitrate
}
`
);
expect
(
bitrate
).
assertEqual
(
expectBitrateArray
[
videoSizeId
]);
bitrateDoneCnt
++
;
});
avPlayer
.
on
(
'
videoSizeChange
'
,
(
w
,
h
)
=>
{
console
.
info
(
'
case videoSizeChange width:
'
+
w
+
'
height:
'
+
h
+
'
videoSizeId:
'
+
videoSizeId
);
if
(
w
==
videoSizeArray
[
videoSizeId
][
0
]
&&
h
==
videoSizeArray
[
videoSizeId
][
1
])
{
avPlayer
.
release
().
then
(()
=>
{
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
}
});
avPlayer
.
on
(
'
availableBitrates
'
,
(
bitrates
)
=>
{
bitrateArray
=
bitrates
;
checkArray
(
bitrateArray
,
expectBitrateArray
);
availableBitratesCnt
++
;
});
console
.
info
(
`case src is
${
src
}
`
);
avPlayer
.
url
=
src
;
}
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0100
* @tc.name : 001.test hls
* @tc.desc : HLS setBitrate test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0100
'
,
0
,
async
function
(
done
)
{
await
initAVPlayer
(
HTTP_PATH
+
'
05.hls/hls_variant/index.m3u8
'
,
done
);
expectBitrateArray
=
[
165340
,
344388
,
387360
,
765178
,
1676816
];
setBitrateState
=
AVPlayerTestBase
.
AV_PLAYER_STATE
.
PREPARED
;
videoSizeId
=
1
;
videoSizeArray
=
[
[
256
,
144
],
[
426
,
240
],
[
640
,
360
],
[
854
,
480
],
[
1280
,
720
]
];
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0200
* @tc.name : 001.test hls
* @tc.desc : HLS setBitrate test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0200
'
,
0
,
async
function
(
done
)
{
await
initAVPlayer
(
HTTP_PATH
+
'
05.hls/hls_variant/index.m3u8
'
,
done
);
expectBitrateArray
=
[
165340
,
344388
,
387360
,
765178
,
1676816
];
setBitrateState
=
AVPlayerTestBase
.
AV_PLAYER_STATE
.
PLAYING
;
videoSizeId
=
1
;
videoSizeArray
=
[
[
256
,
144
],
[
426
,
240
],
[
640
,
360
],
[
854
,
480
],
[
1280
,
720
]
];
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0300
* @tc.name : 001.test hls
* @tc.desc : HLS setBitrate test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0300
'
,
0
,
async
function
(
done
)
{
await
initAVPlayer
(
HTTP_PATH
+
'
05.hls/hls_variant/index.m3u8
'
,
done
);
expectBitrateArray
=
[
165340
,
344388
,
387360
,
765178
,
1676816
];
setBitrateState
=
AVPlayerTestBase
.
AV_PLAYER_STATE
.
PAUSED
;
videoSizeId
=
1
;
videoSizeArray
=
[
[
256
,
144
],
[
426
,
240
],
[
640
,
360
],
[
854
,
480
],
[
1280
,
720
]
];
await
mediaTestBase
.
msleepAsync
(
PLAY_TIME
);
avPlayer
.
pause
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0400
* @tc.name : 001.test hls
* @tc.desc : HLS setBitrate test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0400
'
,
0
,
async
function
(
done
)
{
await
initAVPlayer
(
HTTP_PATH
+
'
05.hls/hls_variant/index.m3u8
'
,
done
);
expectBitrateArray
=
[
165340
,
344388
,
387360
,
765178
,
1676816
];
setBitrateState
=
AVPlayerTestBase
.
AV_PLAYER_STATE
.
COMPLETED
;
videoSizeId
=
1
;
videoSizeArray
=
[
[
256
,
144
],
[
426
,
240
],
[
640
,
360
],
[
854
,
480
],
[
1280
,
720
]
];
await
mediaTestBase
.
msleepAsync
(
PLAY_TIME
);
avPlayer
.
loop
=
false
;
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0500
* @tc.name : 001.test hls
* @tc.desc : HLS setBitrate test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_HLS_setBitrate_0500
'
,
0
,
async
function
(
done
)
{
await
initAVPlayer
(
HTTP_PATH
+
'
05.hls/hls_variant/index.m3u8
'
,
done
);
expectBitrateArray
=
[
165340
,
344388
,
387360
,
765178
,
1676816
];
setBitrateState
=
AVPlayerTestBase
.
AV_PLAYER_STATE
.
PREPARED
;
videoSizeId
=
3
;
videoSizeArray
=
[
[
256
,
144
],
[
426
,
240
],
[
640
,
360
],
[
854
,
480
],
[
1280
,
720
]
];
})
});
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpCompatibilityTest.test.ets
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import {testAVPlayerFun} from '../../../../../../AVPlayerTestBase.js';
import * as mediaTestBase from '../../../../../../MediaTestBase';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
export default function AVPlayerHttpCompatibilityTest() {
describe('AVPlayerHttpCompatibilityTest', function () {
const HTTP_PATH = 'http://xxx.xx.xx.xx:xxxx/';
const VIDEO_PATH = HTTP_PATH + '01.video/';
const AUDIO_PATH = HTTP_PATH + '02.audio/';
const VIDEOPLAYER_PATH = HTTP_PATH + '03.videoplayer/';
const AUDIOPLAYER_PATH = HTTP_PATH + '04.audioplayer/';
const PLAY_TIME = 3000;
let avPlayer = null;
let avPlayTest = {
width: 0,
height: 0,
duration: -1,
}
beforeAll(async function() {
console.info('beforeAll case');
})
beforeEach(async function() {
console.info('beforeEach case');
})
afterEach(async function() {
console.info('afterEach case');
})
afterAll(async function() {
console.info('afterAll case');
if (avPlayer != null) {
avPlayer.release().then(() => {
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
}
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_MP4_0100
* @tc.name : 001.H264_AAC
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_MP4_0100', 0, async function (done) {
let path = VIDEOPLAYER_PATH + 'mp4/h264_aac_640x320_30r.mp4';
avPlayTest = { width: 640, height: 320, duration: 10100 };
testAVPlayerFun(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_MP4_0200
* @tc.name : 002.H264_MP3
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_MP4_0200', 0, async function (done) {
let path = VIDEOPLAYER_PATH + 'mp4/h264_mp3_640x480_25r.mp4';
avPlayTest = { width: 640, height: 480, duration: 10080 };
testAVPlayerFun(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_TS_0100
* @tc.name : 001.H264_AAC
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_TS_0100', 0, async function (done) {
let path = VIDEOPLAYER_PATH + 'mpeg_ts/h264_aac_640x480_30r.ts';
avPlayTest = { width: 640, height: 480, duration: 10161 };
testAVPlayerFun(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_TS_0200
* @tc.name : 002.H264_MP3
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_TS_0200', 0, async function (done) {
let path = VIDEOPLAYER_PATH + 'mpeg_ts/h264_mp3_640x480_25r.ts';
avPlayTest = { width: 640, height: 480, duration: 10169 };
testAVPlayerFun(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_MKV_0100
* @tc.name : 001.H264_AAC
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_FORMAT_MKV_0100', 0, async function (done) {
let path = VIDEO_PATH + 'H264_AAC.mkv';
avPlayTest = { width: 720, height: 480, duration: 10057 };
testAVPlayerFun(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
});
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpSeekTest.test.ets
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import {testAVPlayerSeek} from '../../../../../../AVPlayerTestBase.js';
import * as mediaTestBase from '../../../../../../MediaTestBase';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
export default function AVPlayerHttpSeekTest() {
describe('AVPlayerHttpSeekTest', function () {
const HTTP_PATH = 'http://xxx.xx.xx.xx:xxxx/';
const VIDEO_PATH = HTTP_PATH + '01.video/';
const AUDIO_PATH = HTTP_PATH + '02.audio/';
const VIDEOPLAYER_PATH = HTTP_PATH + '03.videoplayer/';
const AUDIOPLAYER_PATH = HTTP_PATH + '04.audioplayer/';
const PLAY_TIME = 3000;
let avPlayer = null;
let avPlayTest = {
width: 0,
height: 0,
duration: -1,
}
beforeAll(async function() {
console.info('beforeAll case');
})
beforeEach(async function() {
console.info('beforeEach case');
})
afterEach(async function() {
console.info('afterEach case');
})
afterAll(async function() {
console.info('afterAll case');
if (avPlayer != null) {
avPlayer.release().then(() => {
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
}
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_MP4_0100
* @tc.name : 001.H264_AAC
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_MP4_0100', 0, async function (done) {
let path = VIDEOPLAYER_PATH + 'mp4/h264_aac_640x320_30r.mp4';
avPlayTest = { width: 640, height: 320, duration: 10100 };
testAVPlayerSeek(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_MP4_0200
* @tc.name : 002.H264_MP3
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_MP4_0200', 0, async function (done) {
let path = VIDEOPLAYER_PATH + 'mp4/h264_mp3_640x480_25r.mp4';
avPlayTest = { width: 640, height: 480, duration: 10080 };
testAVPlayerSeek(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_TS_0100
* @tc.name : 001.H264_AAC
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_TS_0100', 0, async function (done) {
let path = VIDEOPLAYER_PATH + 'mpeg_ts/h264_aac_640x480_30r.ts';
avPlayTest = { width: 640, height: 480, duration: 10161 };
testAVPlayerSeek(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_TS_0200
* @tc.name : 002.H264_MP3
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_TS_0200', 0, async function (done) {
let path = VIDEOPLAYER_PATH + 'mpeg_ts/h264_mp3_640x480_25r.ts';
avPlayTest = { width: 640, height: 480, duration: 10169 };
testAVPlayerSeek(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_MKV_0100
* @tc.name : 001.H264_AAC
* @tc.desc : Http playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_AVPLAYER_HTTP_SEEK_FORMAT_MKV_0100', 0, async function (done) {
let path = VIDEO_PATH + 'H264_AAC.mkv';
avPlayTest = { width: 720, height: 480, duration: 10057 };
testAVPlayerSeek(path, avPlayer, avPlayTest, PLAY_TIME, done);
})
});
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js
0 → 100644
浏览文件 @
cbea9d05
此差异已折叠。
点击以展开。
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerStabilityTest.test.js
0 → 100644
浏览文件 @
cbea9d05
此差异已折叠。
点击以展开。
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AvPlayerEnumTest.test.js
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import
media
from
'
@ohos.multimedia.media
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
export
default
function
AvPlayerEnumTest
()
{
describe
(
'
AvPlayerEnumTest
'
,
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach case
'
);
})
afterEach
(
function
()
{
console
.
info
(
'
afterEach case
'
);
})
afterAll
(
function
()
{
console
.
info
(
'
afterAll case
'
);
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_RECORDER_ENUM_AUDIO_OUTPUT_FORMAT_0100
* @tc.name : AVPlayer
* @tc.desc : AVPlayer Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_ENUM_0100
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
StateChangeReason
.
USER
).
assertEqual
(
1
);
done
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_ENUM_0200
* @tc.name : AVPlayer
* @tc.desc : AVPlayer Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_ENUM_0200
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
AVErrorCode
.
AVERR_OK
).
assertEqual
(
0
);
expect
(
media
.
AVErrorCode
.
AVERR_NO_PERMISSION
).
assertEqual
(
201
);
expect
(
media
.
AVErrorCode
.
AVERR_INVALID_PARAMETER
).
assertEqual
(
401
);
expect
(
media
.
AVErrorCode
.
AVERR_UNSUPPORT_CAPABILITY
).
assertEqual
(
801
);
expect
(
media
.
AVErrorCode
.
AVERR_NO_MEMORY
).
assertEqual
(
5400101
);
expect
(
media
.
AVErrorCode
.
AVERR_OPERATE_NOT_PERMIT
).
assertEqual
(
5400102
);
expect
(
media
.
AVErrorCode
.
AVERR_IO
).
assertEqual
(
5400103
);
expect
(
media
.
AVErrorCode
.
AVERR_TIMEOUT
).
assertEqual
(
5400104
);
expect
(
media
.
AVErrorCode
.
AVERR_SERVICE_DIED
).
assertEqual
(
5400105
);
expect
(
media
.
AVErrorCode
.
AVERR_UNSUPPORT_FORMAT
).
assertEqual
(
5400106
);
done
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_ENUM_0300
* @tc.name : AVPlayer
* @tc.desc : AVPlayer Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_ENUM_0300
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
CodecMimeType
.
VIDEO_H263
).
assertEqual
(
'
video/h263
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_AVC
).
assertEqual
(
'
video/avc
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_MPEG2
).
assertEqual
(
'
video/mpeg2
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_MPEG4
).
assertEqual
(
'
video/mp4v-es
'
);
expect
(
media
.
CodecMimeType
.
VIDEO_VP8
).
assertEqual
(
'
video/x-vnd.on2.vp8
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_AAC
).
assertEqual
(
'
audio/mp4a-latm
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_VORBIS
).
assertEqual
(
'
audio/vorbis
'
);
expect
(
media
.
CodecMimeType
.
AUDIO_FLAC
).
assertEqual
(
'
audio/flac
'
);
done
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVPLAYER_ENUM_0400
* @tc.name : AVPlayer
* @tc.desc : AVPlayer Enumeration test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it
(
'
SUB_MULTIMEDIA_MEDIA_AVPLAYER_ENUM_0400
'
,
0
,
async
function
(
done
)
{
expect
(
media
.
AudioSourceType
.
AUDIO_SOURCE_TYPE_DEFAULT
).
assertEqual
(
0
);
done
();
})
})
}
multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
cbea9d05
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
import AVPlayerHlsFuncTest from './AVPlayerHlsFuncTest.test.js'
import AVPlayerHttpCompatibilityTest from './AVPlayerHttpCompatibilityTest.test.ets'
import AVPlayerHttpSeekTest from './AVPlayerHttpSeekTest.test.ets'
import AVPlayerLocalTest from './AVPlayerLocalTest.test.js'
import AVPlayerStabilityTest from './AVPlayerStabilityTest.test.js'
import AvPlayerEnumTest from './AvPlayerEnumTest.test.js'
export default function testsuite() {
// AVPlayerHlsFuncTest()
// AVPlayerHttpCompatibilityTest();
// AVPlayerHttpSeekTest();
AvPlayerEnumTest();
AVPlayerLocalTest();
AVPlayerStabilityTest();
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/module.json
0 → 100644
浏览文件 @
cbea9d05
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"ohos.acts.multimedia.avplayer.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:[
"entity.system.home"
]
}
]
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.MEDIA_LOCATION"
,
"reason"
:
"use ohos.permission.MEDIA_LOCATION"
},
{
"name"
:
"ohos.permission.READ_MEDIA"
,
"reason"
:
"use ohos.permission.READ_MEDIA"
},
{
"name"
:
"ohos.permission.WRITE_MEDIA"
,
"reason"
:
"use ohos.permission.WRITE_MEDIA"
}
]
}
}
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
cbea9d05
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
cbea9d05
15.1 KB
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
cbea9d05
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
]
}
\ No newline at end of file
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/rawfile/01.mp3
0 → 100644
浏览文件 @
cbea9d05
文件已添加
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/rawfile/H264_AAC.mp4
0 → 100644
LFS
浏览文件 @
cbea9d05
文件已添加
multimedia/media/media_js_standard/avPlayer/entry/src/main/resources/rawfile/H264_NONE.mp4
0 → 100644
LFS
浏览文件 @
cbea9d05
文件已添加
multimedia/media/media_js_standard/avPlayer/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
cbea9d05
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录