提交 22292855 编写于 作者: D dongxinli

add avplayer

Signed-off-by: Ndongxinli <dongxinli@huawei.com>
上级 b0023f97
...@@ -106,6 +106,18 @@ export default function AVPlayerMultiTrackTest() { ...@@ -106,6 +106,18 @@ export default function AVPlayerMultiTrackTest() {
}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback); }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
} }
async function getCurrentAudioTrackCall() {
await avPlayer.getCurrentTrack(0, (err, index) => {
if (err == null) {
console.info(`case current audio track index is ${index}`);
currentTrack = index;
} else {
console.error('getCurrentTrack failed and error is ' + err.message);
}
});
}
async function changeAudioTrack() { async function changeAudioTrack() {
for(let i = 0; i < audioTrackList.length; i++) { for(let i = 0; i < audioTrackList.length; i++) {
if (audioTrackList[i] != currentTrack) { if (audioTrackList[i] != currentTrack) {
...@@ -223,7 +235,7 @@ export default function AVPlayerMultiTrackTest() { ...@@ -223,7 +235,7 @@ export default function AVPlayerMultiTrackTest() {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_MULTI_AUDIOTRACK_FUNC_0100', 0, async function (done) { it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_MULTI_AUDIOTRACK_FUNC_0100', 0, async function (done) {
async function preparedOperation() { async function preparedOperation() {
await getAudioTracks(); await getAudioTracks();
await getCurrentAudioTrack(); await getCurrentAudioTrackCall();
await changeAudioTrack(); await changeAudioTrack();
avPlayer.selectTrack(selectedTrack); avPlayer.selectTrack(selectedTrack);
expect(currentTrack!=selectedTrack).assertTrue(); expect(currentTrack!=selectedTrack).assertTrue();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册