Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a43b106b
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看板
提交
a43b106b
编写于
4月 29, 2022
作者:
N
NOBUGGERS
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
videoPlayer 基类函数 Signed-off-by: NOBUGGERS <ruanmeng@huawei.com>
Signed-off-by:
N
NOBUGGERS
<
ruanmeng@huawei.com
>
上级
714752d1
变更
8
展开全部
显示空白变更内容
内联
并排
Showing
8 changed file
with
206 addition
and
1272 deletion
+206
-1272
multimedia/media/media_js_standard/VideoPlayerTestBase.js
multimedia/media/media_js_standard/VideoPlayerTestBase.js
+186
-0
multimedia/media/media_js_standard/videoPlayer/Test.json
multimedia/media/media_js_standard/videoPlayer/Test.json
+1
-70
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js
...dia_js_standard/videoPlayer/src/main/js/test/List.test.js
+1
-2
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js
...layer/src/main/js/test/VideoPlayerAPICallbackTest.test.js
+6
-4
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFormatCompatibilityTest.test.js
...c/main/js/test/VideoPlayerFormatCompatibilityTest.test.js
+0
-1151
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js
...ayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js
+6
-4
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
...layer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
+6
-4
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerTestBase.js
...ndard/videoPlayer/src/main/js/test/VideoPlayerTestBase.js
+0
-37
未找到文件。
multimedia/media/media_js_standard/VideoPlayerTestBase.js
0 → 100644
浏览文件 @
a43b106b
/*
* 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
'
import
media
from
'
@ohos.multimedia.media
'
import
*
as
mediaTestBase
from
'
./MediaTestBase.js
'
;
export
async
function
toNewPage
(
pagePath1
,
pagePath2
,
page
)
{
let
path
=
''
;
if
(
page
==
0
)
{
path
=
'
pages/surfaceTest/surfaceTest
'
;
}
else
{
path
=
'
pages/surfaceTest2/surfaceTest2
'
;
}
let
options
=
{
uri
:
path
,
}
try
{
await
router
.
push
(
options
);
}
catch
{
console
.
info
(
'
case route failed
'
);
}
}
export
async
function
clearRouter
()
{
await
router
.
clear
();
}
export
async
function
playVideoSource
(
url
,
width
,
height
,
duration
,
playTime
)
{
console
.
info
(
`case media source url:
${
url
}
`
)
let
videoPlayer
=
null
;
let
surfaceID
=
globalThis
.
value
;
await
media
.
createVideoPlayer
().
then
((
video
)
=>
{
if
(
typeof
(
video
)
!=
'
undefined
'
)
{
console
.
info
(
'
case createVideoPlayer success
'
);
videoPlayer
=
video
;
}
else
{
console
.
error
(
'
case createVideoPlayer failed
'
);
expect
().
assertFail
();
}
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
videoPlayer
.
on
(
'
videoSizeChanged
'
,
(
w
,
h
)
=>
{
console
.
info
(
'
case videoSizeChanged width:
'
+
w
+
'
height:
'
+
h
);
});
videoPlayer
.
on
(
'
error
'
,
(
err
)
=>
{
console
.
error
(
`case error called, errMessage is
${
err
.
message
}
`
);
expect
().
assertFail
();
});
videoPlayer
.
url
=
url
;
if
(
width
!=
null
&
height
!=
null
)
{
await
videoPlayer
.
setDisplaySurface
(
surfaceID
).
then
(()
=>
{
console
.
info
(
'
case setDisplaySurface success, surfaceID:
'
+
surfaceID
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
}
await
videoPlayer
.
prepare
().
then
(()
=>
{
console
.
info
(
'
case prepare called
'
);
expect
(
videoPlayer
.
duration
).
assertClose
(
duration
,
500
);
if
(
width
!=
null
&
height
!=
null
)
{
expect
(
videoPlayer
.
width
).
assertEqual
(
width
);
expect
(
videoPlayer
.
height
).
assertEqual
(
height
);
}
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
getTrackDescription
().
then
((
arrayList
)
=>
{
console
.
info
(
'
case getTrackDescription called
'
);
if
(
typeof
(
arrayList
)
!=
'
undefined
'
)
{
for
(
let
i
=
0
;
i
<
arrayList
.
length
;
i
++
)
{
mediaTestBase
.
printDescription
(
arrayList
[
i
]);
}
}
else
{
console
.
error
(
'
case getTrackDescription failed
'
);
expect
().
assertFail
();
}
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
let
startTime
=
videoPlayer
.
currentTime
;
await
videoPlayer
.
play
().
then
(()
=>
{
console
.
info
(
'
case play called
'
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
playing
'
);
mediaTestBase
.
msleep
(
playTime
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
let
endTime
=
videoPlayer
.
currentTime
;
expect
(
endTime
-
startTime
).
assertClose
(
playTime
,
1000
);
await
videoPlayer
.
seek
(
videoPlayer
.
duration
/
3
).
then
((
seekDoneTime
)
=>
{
console
.
info
(
'
case seek called and seekDoneTime is
'
+
seekDoneTime
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
playing
'
);
mediaTestBase
.
msleep
(
playTime
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
pause
().
then
(()
=>
{
console
.
info
(
'
case pause called
'
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
paused
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
videoPlayer
.
loop
=
true
;
await
videoPlayer
.
seek
(
0
,
media
.
SeekMode
.
SEEK_NEXT_SYNC
).
then
((
seekDoneTime
)
=>
{
expect
(
videoPlayer
.
state
).
assertEqual
(
'
paused
'
);
console
.
info
(
'
case seek called and seekDoneTime is
'
+
seekDoneTime
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
play
().
then
(()
=>
{
console
.
info
(
'
case play called
'
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
playing
'
);
mediaTestBase
.
msleep
(
playTime
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
setSpeed
(
media
.
PlaybackSpeed
.
SPEED_FORWARD_2_00_X
).
then
((
speedMode
)
=>
{
console
.
info
(
'
case setSpeed called and speedMode is
'
+
speedMode
);
mediaTestBase
.
msleep
(
playTime
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
setVolume
(
0.5
).
then
(()
=>
{
console
.
info
(
'
case setVolume called
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
seek
(
duration
,
media
.
SeekMode
.
SEEK_NEXT_SYNC
).
then
((
seekDoneTime
)
=>
{
console
.
info
(
'
case seek called and seekDoneTime is
'
+
seekDoneTime
);
mediaTestBase
.
msleep
(
duration
-
seekDoneTime
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
playing
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
videoPlayer
.
loop
=
false
;
await
videoPlayer
.
seek
(
duration
,
media
.
SeekMode
.
SEEK_NEXT_SYNC
).
then
((
seekDoneTime
)
=>
{
console
.
info
(
'
case seek called and seekDoneTime is
'
+
seekDoneTime
);
mediaTestBase
.
msleep
(
duration
-
seekDoneTime
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
stopped
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
play
().
then
(()
=>
{
console
.
info
(
'
case play called
'
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
playing
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
stop
().
then
(()
=>
{
console
.
info
(
'
case stop called
'
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
stopped
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
reset
().
then
(()
=>
{
console
.
info
(
'
case reset called
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
videoPlayer
.
url
=
url
;
await
videoPlayer
.
setDisplaySurface
(
surfaceID
).
then
(()
=>
{
console
.
info
(
'
case setDisplaySurface success, surfaceID:
'
+
surfaceID
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
prepare
().
then
(()
=>
{
console
.
info
(
'
case prepare called
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
play
().
then
(()
=>
{
console
.
info
(
'
case play called
'
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
playing
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
pause
().
then
(()
=>
{
console
.
info
(
'
case pause called
'
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
paused
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
stop
().
then
(()
=>
{
console
.
info
(
'
case stop called
'
);
expect
(
videoPlayer
.
state
).
assertEqual
(
'
stopped
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
await
videoPlayer
.
release
().
then
(()
=>
{
console
.
info
(
'
case release called
'
);
},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
}
\ No newline at end of file
multimedia/media/media_js_standard/videoPlayer/Test.json
浏览文件 @
a43b106b
...
@@ -27,76 +27,7 @@
...
@@ -27,76 +27,7 @@
"pre-push"
:
[
"pre-push"
:
[
],
],
"push"
:
[
"push"
:
[
"./resource/audio/H264_AAC.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/H264_AAC.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
"./resource/audio/h264_none_audio.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_none_audio.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_none_audio.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/none_video_aac.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/none_video_mp3.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_aac_720p_30r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_mp3_480p_25r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_mp3_270p_10r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_aac_320x240_30r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_mp3_480x320_30r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_aac_640x480_30r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_mp3_640x480_25r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_none_audio_640x480_30r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_none_audio_640x480_30r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_none_audio_640x480_30r.mp4 ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_none_audio.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_none_audio.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_none_audio.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/none_video_aac.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/none_video_mp3.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_aac_720p_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_aac_480p_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_aac_270p_10r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_mp3_720p_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_mp3_480p_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_mp3_270p_10r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_aac_720p_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_aac_480p_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_aac_270p_10r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_mp3_720p_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_mp3_480p_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_mp3_270p_10r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_720p_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_480p_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_270p_10r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_mp3_720p_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_mp3_480p_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_mp3_270p_10r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_none_audio_640x480_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_none_audio_640x480_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_none_audio_640x480_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_aac_640x480_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_mp3_640x480_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_aac_640x480_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_mp3_640x480_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_640x480_30r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_mp3_640x480_25r.ts ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/vp8_none_audio.webm ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/none_video_vorbis.webm ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/vp8_vorbis_720p_30r.webm ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/vp8_vorbis_480p_25r.webm ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/vp8_vorbis_270p_10r.webm ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/vp8_none_audio_640x480_30r.webm ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/vp8_vorbis_640x480_25r.webm ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_none_audio.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_none_audio.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_none_audio.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/none_video_aac.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/none_video_mp3.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_720p_30r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_480p_25r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_270p_10r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h264_none_audio_640x480_30r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h263_none_audio_640x480_30r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg2_none_audio_640x480_30r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_none_audio_640x480_30r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/h263_aac_640x480_30r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_640x480_30r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
,
"./resource/audio/mpeg4_aac_270p_25r.mkv ->/data/app/el1/bundle/public/ohos.acts.multimedia.video.videoplayer/ohos.acts.multimedia.video.videoplayer/assets/entry/resources/rawfile/"
]
]
}
}
]
]
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js
浏览文件 @
a43b106b
...
@@ -17,4 +17,3 @@ require('./VideoPlayerFuncCallbackTest.test.js')
...
@@ -17,4 +17,3 @@ require('./VideoPlayerFuncCallbackTest.test.js')
require
(
'
./VideoPlayerFuncPromiseTest.test.js
'
)
require
(
'
./VideoPlayerFuncPromiseTest.test.js
'
)
require
(
'
./VideoPlayerAPICallbackTest.test.js
'
)
require
(
'
./VideoPlayerAPICallbackTest.test.js
'
)
require
(
'
./VideoPlayerEnumTest.test.js
'
)
require
(
'
./VideoPlayerEnumTest.test.js
'
)
require
(
'
./VideoPlayerFormatCompatibilityTest.test.js
'
)
\ No newline at end of file
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js
浏览文件 @
a43b106b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
import
media
from
'
@ohos.multimedia.media
'
import
media
from
'
@ohos.multimedia.media
'
import
{
toNewPage
,
clearRouter
}
from
'
./VideoPlayerTestBase.js
'
;
import
{
toNewPage
,
clearRouter
}
from
'
.
./../../../..
/VideoPlayerTestBase.js
'
;
import
*
as
mediaTestBase
from
'
../../../../../MediaTestBase.js
'
;
import
*
as
mediaTestBase
from
'
../../../../../MediaTestBase.js
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
...
@@ -49,7 +49,9 @@ describe('VideoPlayerAPICallbackTest', function () {
...
@@ -49,7 +49,9 @@ describe('VideoPlayerAPICallbackTest', function () {
const
DELTA_TIME
=
100
;
const
DELTA_TIME
=
100
;
let
surfaceID
=
''
;
let
surfaceID
=
''
;
let
fileDescriptor
=
undefined
;
let
fileDescriptor
=
undefined
;
let
page
=
0
;
const
pagePath1
=
'
pages/surfaceTest/surfaceTest
'
;
const
pagePath2
=
'
pages/surfaceTest2/surfaceTest2
'
;
let
pageId
=
0
;
let
fdHead
=
'
fd://
'
;
let
fdHead
=
'
fd://
'
;
let
events
=
require
(
'
events
'
);
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
eventEmitter
=
new
events
.
EventEmitter
();
...
@@ -62,8 +64,8 @@ describe('VideoPlayerAPICallbackTest', function () {
...
@@ -62,8 +64,8 @@ describe('VideoPlayerAPICallbackTest', function () {
await
mediaTestBase
.
getFileDescriptor
(
VIDEO_SOURCE
).
then
((
res
)
=>
{
await
mediaTestBase
.
getFileDescriptor
(
VIDEO_SOURCE
).
then
((
res
)
=>
{
fileDescriptor
=
res
;
fileDescriptor
=
res
;
});
});
await
toNewPage
(
page
);
await
toNewPage
(
page
Path1
,
pagePath2
,
pageId
);
page
=
(
page
+
1
)
%
2
;
page
Id
=
(
pageId
+
1
)
%
2
;
await
mediaTestBase
.
msleepAsync
(
1000
).
then
(
await
mediaTestBase
.
msleepAsync
(
1000
).
then
(
()
=>
{},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
()
=>
{},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
surfaceID
=
globalThis
.
value
;
surfaceID
=
globalThis
.
value
;
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFormatCompatibilityTest.test.js
已删除
100644 → 0
浏览文件 @
714752d1
此差异已折叠。
点击以展开。
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js
浏览文件 @
a43b106b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
import
media
from
'
@ohos.multimedia.media
'
import
media
from
'
@ohos.multimedia.media
'
import
{
toNewPage
,
clearRouter
}
from
'
./VideoPlayerTestBase.js
'
;
import
{
toNewPage
,
clearRouter
}
from
'
.
./../../../..
/VideoPlayerTestBase.js
'
;
import
*
as
mediaTestBase
from
'
../../../../../MediaTestBase.js
'
;
import
*
as
mediaTestBase
from
'
../../../../../MediaTestBase.js
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
...
@@ -52,7 +52,9 @@ describe('VideoPlayerFuncCallbackTest', function () {
...
@@ -52,7 +52,9 @@ describe('VideoPlayerFuncCallbackTest', function () {
let
surfaceID
=
''
;
let
surfaceID
=
''
;
let
fdHead
=
'
fd://
'
;
let
fdHead
=
'
fd://
'
;
let
fileDescriptor
=
undefined
;
let
fileDescriptor
=
undefined
;
let
page
=
0
;
const
pagePath1
=
'
pages/surfaceTest/surfaceTest
'
;
const
pagePath2
=
'
pages/surfaceTest2/surfaceTest2
'
;
let
pageId
=
0
;
let
events
=
require
(
'
events
'
);
let
events
=
require
(
'
events
'
);
let
eventEmitter
=
new
events
.
EventEmitter
();
let
eventEmitter
=
new
events
.
EventEmitter
();
...
@@ -64,8 +66,8 @@ describe('VideoPlayerFuncCallbackTest', function () {
...
@@ -64,8 +66,8 @@ describe('VideoPlayerFuncCallbackTest', function () {
})
})
beforeEach
(
async
function
()
{
beforeEach
(
async
function
()
{
await
toNewPage
(
page
);
await
toNewPage
(
page
Path1
,
pagePath2
,
pageId
);
page
=
(
page
+
1
)
%
2
;
page
Id
=
(
pageId
+
1
)
%
2
;
await
mediaTestBase
.
msleepAsync
(
1000
).
then
(
await
mediaTestBase
.
msleepAsync
(
1000
).
then
(
()
=>
{},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
()
=>
{},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
surfaceID
=
globalThis
.
value
;
surfaceID
=
globalThis
.
value
;
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js
浏览文件 @
a43b106b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
import
media
from
'
@ohos.multimedia.media
'
import
media
from
'
@ohos.multimedia.media
'
import
{
toNewPage
,
clearRouter
}
from
'
./VideoPlayerTestBase.js
'
;
import
{
toNewPage
,
clearRouter
}
from
'
.
./../../../..
/VideoPlayerTestBase.js
'
;
import
*
as
mediaTestBase
from
'
../../../../../MediaTestBase.js
'
;
import
*
as
mediaTestBase
from
'
../../../../../MediaTestBase.js
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
...
@@ -32,7 +32,9 @@ describe('VideoPlayerFuncPromiseTest', function () {
...
@@ -32,7 +32,9 @@ describe('VideoPlayerFuncPromiseTest', function () {
let
surfaceID
=
''
;
let
surfaceID
=
''
;
let
fdHead
=
'
fd://
'
;
let
fdHead
=
'
fd://
'
;
let
fileDescriptor
=
undefined
;
let
fileDescriptor
=
undefined
;
let
page
=
0
;
const
pagePath1
=
'
pages/surfaceTest/surfaceTest
'
;
const
pagePath2
=
'
pages/surfaceTest2/surfaceTest2
'
;
let
pageId
=
0
;
beforeAll
(
async
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll case
'
);
console
.
info
(
'
beforeAll case
'
);
...
@@ -42,8 +44,8 @@ describe('VideoPlayerFuncPromiseTest', function () {
...
@@ -42,8 +44,8 @@ describe('VideoPlayerFuncPromiseTest', function () {
})
})
beforeEach
(
async
function
()
{
beforeEach
(
async
function
()
{
await
toNewPage
(
page
);
await
toNewPage
(
page
Path1
,
pagePath2
,
pageId
);
page
=
(
page
+
1
)
%
2
;
page
Id
=
(
pageId
+
1
)
%
2
;
await
mediaTestBase
.
msleepAsync
(
1000
).
then
(
await
mediaTestBase
.
msleepAsync
(
1000
).
then
(
()
=>
{},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
()
=>
{},
mediaTestBase
.
failureCallback
).
catch
(
mediaTestBase
.
catchCallback
);
surfaceID
=
globalThis
.
value
;
surfaceID
=
globalThis
.
value
;
...
...
multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerTestBase.js
已删除
100644 → 0
浏览文件 @
714752d1
/*
* 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
'
export
async
function
toNewPage
(
page
)
{
let
path
=
''
;
if
(
page
==
0
)
{
path
=
'
pages/surfaceTest/surfaceTest
'
;
}
else
{
path
=
'
pages/surfaceTest2/surfaceTest2
'
;
}
let
options
=
{
uri
:
path
,
}
try
{
await
router
.
push
(
options
);
}
catch
{
console
.
info
(
'
case route failed
'
);
}
}
export
async
function
clearRouter
()
{
await
router
.
clear
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录