From 5bbdebf2cdeefc528c81d5ff9361b6a46639530a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E5=AE=97=E6=98=8E?= Date: Thu, 29 May 2025 15:21:07 +0800 Subject: [PATCH 1/4] Fix git commands so that can copy, paste, and work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 韩宗明 --- code/DocsSample/Media/AVPlayer/AVPlayerArkTSAudio/README.md | 2 +- code/DocsSample/Media/AVPlayer/AVPlayerArkTSSubtitle/README.md | 2 +- code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/README.md | 2 +- code/DocsSample/Media/AVPlayer/AVPlayerArkTSVideo/README.md | 2 +- code/DocsSample/Media/AVPlayer/AVPlayerNDKAudio/README.md | 2 +- code/DocsSample/Media/AVPlayer/AVPlayerNDKVideo/README.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSAudio/README.md b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSAudio/README.md index 1c5e051e9c..3a670022bd 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSAudio/README.md +++ b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSAudio/README.md @@ -61,6 +61,6 @@ entry/src/ohosTest/ets/ git init git config core.sparsecheckout true echo code/DocsSample/Media/AVPlayer/AVPlayerArkTSAudio/ > .git/info/sparse-checkout -git remote add origin OpenHarmony/applications_app_samples +git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master ``` \ No newline at end of file diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSSubtitle/README.md b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSSubtitle/README.md index db1b864c0c..4a4b59a652 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSSubtitle/README.md +++ b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSSubtitle/README.md @@ -62,6 +62,6 @@ entry/src/ohosTest/ets/ git init git config core.sparsecheckout true echo code/DocsSample/Media/AVPlayer/AVPlayerArkTSSubtitle/ > .git/info/sparse-checkout -git remote add origin OpenHarmony/applications_app_samples +git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master ``` \ No newline at end of file diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/README.md b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/README.md index 26cc985616..115d7b5ee0 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/README.md +++ b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/README.md @@ -63,6 +63,6 @@ ohos.permission.GET_WIFI_INFO git init git config core.sparsecheckout true echo code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/ > .git/info/sparse-checkout -git remote add origin OpenHarmony/applications_app_samples +git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master ``` \ No newline at end of file diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSVideo/README.md b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSVideo/README.md index 104c91137e..0c1b575c85 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSVideo/README.md +++ b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSVideo/README.md @@ -61,6 +61,6 @@ entry/src/ohosTest/ets/ git init git config core.sparsecheckout true echo code/DocsSample/Media/AVPlayer/AVPlayerArkTSVideo/ > .git/info/sparse-checkout -git remote add origin OpenHarmony/applications_app_samples +git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master ``` \ No newline at end of file diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerNDKAudio/README.md b/code/DocsSample/Media/AVPlayer/AVPlayerNDKAudio/README.md index 84f73ba8a8..6bb140a448 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerNDKAudio/README.md +++ b/code/DocsSample/Media/AVPlayer/AVPlayerNDKAudio/README.md @@ -68,6 +68,6 @@ entry/src/ohosTest/ets/ git init git config core.sparsecheckout true echo code/DocsSample/Media/AVPlayer/AVPlayerNDKAudio/ > .git/info/sparse-checkout -git remote add origin OpenHarmony/applications_app_samples +git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master ``` \ No newline at end of file diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerNDKVideo/README.md b/code/DocsSample/Media/AVPlayer/AVPlayerNDKVideo/README.md index e642a1aad7..4fdf17d417 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerNDKVideo/README.md +++ b/code/DocsSample/Media/AVPlayer/AVPlayerNDKVideo/README.md @@ -68,6 +68,6 @@ entry/src/ohosTest/ets/ git init git config core.sparsecheckout true echo code/DocsSample/Media/AVPlayer/AVPlayerNDKVideo/ > .git/info/sparse-checkout -git remote add origin OpenHarmony/applications_app_samples +git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master ``` \ No newline at end of file -- Gitee From a582cff8fdea55f8a71c610961148bd90dea68ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E5=AE=97=E6=98=8E?= Date: Thu, 29 May 2025 15:35:45 +0800 Subject: [PATCH 2/4] Add streamingmedia git fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 韩宗明 --- .../Media/AVPlayer/AVPlayerArkTSStreamingMedia/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSStreamingMedia/README.md b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSStreamingMedia/README.md index 01ebff0b99..245beb7627 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSStreamingMedia/README.md +++ b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSStreamingMedia/README.md @@ -61,6 +61,6 @@ entry/src/ohosTest/ets/ git init git config core.sparsecheckout true echo code/DocsSample/Media/AVPlayer/AVPlayerArkTSStreamingMedia/ > .git/info/sparse-checkout -git remote add origin OpenHarmony/applications_app_samples +git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master ``` \ No newline at end of file -- Gitee From 6e61728155fedce2c55fc11564d864f117d90fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E5=AE=97=E6=98=8E?= Date: Tue, 3 Jun 2025 16:22:29 +0800 Subject: [PATCH 3/4] Fix variable naming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 韩宗明 --- .../AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets index 5f31d4bea5..fb565f268f 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets +++ b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets @@ -56,7 +56,7 @@ struct Index { @State title: Resource = $r('app.string.EntryAbility_label'); @State fileName: string = 'test_01.mp3'; - @State m3u8fileName: string = 'test.m3u8'; + @State m3u8FileName: string = 'test.m3u8'; @State isSwiping: boolean = false; // 用户滑动过程中 @State isPaused: boolean = true; // 暂停播放 @State XComponentFlag: boolean = false; @@ -148,7 +148,7 @@ struct Index { // 情况四:通过本地Raw文件中的m3u8文件播放在线流媒体资源 /* // 通过本地m3u8文件名,获取文件描述符 - let fileDescriptor = await this.context.resourceManager.getRawFd(this.m3u8fileName); + let fileDescriptor = await this.context.resourceManager.getRawFd(this.m3u8FileName); // 用文件描述符构造本地m3u8的URL let fdUrl : string = "fd://" + fileDescriptor.fd + "?offset=" + fileDescriptor.offset + "&size=" + fileDescriptor.length; @@ -169,7 +169,7 @@ struct Index { // 情况五:通过应用沙箱中的m3u8文件播放在线流媒体资源 /* - let filePath = `/data/storage/el1/bundle/${this.m3u8fileName}`; + let filePath = `/data/storage/el1/bundle/${this.m3u8FileName}`; // 通过fs.openSync获取文件句柄 let file = fs.openSync(filePath, fs.OpenMode.READ_ONLY); let fd : string = file.fd.toString(); -- Gitee From 442bdb9f173989e373212087b846c68dc60afd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E5=AE=97=E6=98=8E?= Date: Tue, 3 Jun 2025 17:48:13 +0800 Subject: [PATCH 4/4] Fix absolute path issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 韩宗明 --- .../AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets index fb565f268f..be70853ccb 100644 --- a/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets +++ b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSURL/entry/src/main/ets/pages/Index.ets @@ -169,7 +169,7 @@ struct Index { // 情况五:通过应用沙箱中的m3u8文件播放在线流媒体资源 /* - let filePath = `/data/storage/el1/bundle/${this.m3u8FileName}`; + let filePath = `${this.context.filesDir}/${this.m3u8FileName}`; // 通过fs.openSync获取文件句柄 let file = fs.openSync(filePath, fs.OpenMode.READ_ONLY); let fd : string = file.fd.toString(); @@ -196,8 +196,7 @@ struct Index { // 情况一:应用沙箱文件播放 let fdPath = 'fd://'; // 通过UIAbilityContext获取沙箱地址filesDir,以Stage模型为例 - let pathDir = this.context.filesDir; - let path = `/data/storage/el1/bundle/${this.fileName}`; + let path = `${this.context.filesDir}/${this.fileName}`; // 打开相应的资源文件地址获取fd,并为url赋值触发initialized状态机上报 let file = await fs.open(path); fdPath = fdPath + '' + file.fd; -- Gitee