LecleVietnam / LeclePackageIssue

1 stars 0 forks source link

[Bug] Failed to load the local m3u8 file #12

Open Hackoak opened 1 year ago

Hackoak commented 1 year ago

I am facing an issue with playing the local m3u8 file on both Android & iOS. I tried on both assets & the direct file that path point to local getExternalStorageDirectory() & getApplicationDocumentsDirectory() directories;

Logs listed below

On Android

I/flutter (22508): Parsed url data end : playlist.m3u8 I/flutter (22508): --- Current Video Status --- I/flutter (22508): offline : true I/flutter (22508): --- :3 Done url check --- I/flutter (22508): --- Player status --- I/flutter (22508): play url : assets/m3u8/playlist.m3u8 I/flutter (22508): offline : true I/flutter (22508): --- start playing ––– I/ExoPlayerImpl(22508): Release 7528ab3 [ExoPlayerLib/2.18.1] [generic_x86_arm, AOSP on IA Emulator, Google, 28] [goog.exo.core, goog.exo.exoplayer, goog.exo.decoder, goog.exo.hls, goog.exo.datasource] I/ExoPlayerImpl(22508): Release 8c90d1e [ExoPlayerLib/2.18.1] [generic_x86_arm, AOSP on IA Emulator, Google, 28] [goog.exo.core, goog.exo.exoplayer, goog.exo.decoder, goog.exo.hls, goog.exo.datasource] I/System.out(22508): Keeping screen on I/ExoPlayerImpl(22508): Init 101ca94 [ExoPlayerLib/2.18.1] [generic_x86_arm, AOSP on IA Emulator, Google, 28] I/Choreographer(22508): Skipped 30 frames! The application may be doing too much work on its main thread. I/flutter (22508): Parsed url data end : playlist.m3u8 I/flutter (22508): --- Current Video Status --- I/flutter (22508): offline : true I/flutter (22508): --- :3 Done url check --- I/flutter (22508): --- Player status --- I/flutter (22508): play url : assets/m3u8/playlist.m3u8 I/flutter (22508): offline : true I/flutter (22508): --- start playing ––– I/System.out(22508): Keeping screen on I/ExoPlayerImpl(22508): Init 762388a [ExoPlayerLib/2.18.1] [generic_x86_arm, AOSP on IA Emulator, Google, 28] E/ExoPlayerImplInternal(22508): Playback error E/ExoPlayerImplInternal(22508): com.google.android.exoplayer2.ExoPlaybackException: Source error E/ExoPlayerImplInternal(22508): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632) E/ExoPlayerImplInternal(22508): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604) E/ExoPlayerImplInternal(22508): at android.os.Handler.dispatchMessage(Handler.java:102) E/ExoPlayerImplInternal(22508): at android.os.Looper.loop(Looper.java:193) E/ExoPlayerImplInternal(22508): at android.os.HandlerThread.run(HandlerThread.java:65) E/ExoPlayerImplInternal(22508): Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /assets/m3u8/playlist.m3u8: open failed: ENOENT (No such file or directory) E/ExoPlayerImplInternal(22508): at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:201) E/ExoPlayerImplInternal(22508): at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:112) E/ExoPlayerImplInternal(22508): at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258) E/ExoPlayerImplInternal(22508): at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84) E/ExoPlayerImplInternal(22508): at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:99)

On IOS

flutter: Parsed url data end : playlist.m3u8 flutter: --- Current Video Status --- offline : true --- :3 Done url check --- flutter: --- Player status --- play url : assets/m3u8/playlist.m3u8 offline : true --- start playing ––– flutter: PlatformException(VideoError, Failed to load video: The operation couldn’t be completed. (CoreMediaErrorDomain error -12865.), null, null)

Usage

YoYoPlayer( aspectRatio: 16 / 9, url: 'assets/m3u8/playlist.m3u8', --> // local file path from assets // url: '/Users/hackoak/Library/Developer/CoreSimulator/Devices/2341A598-CE94-4F80-AB75- 73577F490B2F/data/Containers/Data/Application/C1D00120-5189-4FB7-B606-CBBB6D838F2B/Documents/user-post/217d8b1cfcfdb85e4a350fc8f44627db-playlist/playlist.m3u8', --> // local file path from local directory videoStyle: const VideoStyle(), videoLoadingStyle: const VideoLoadingStyle(), allowCacheFile: true, autoPlayVideoAfterInit: true, videoPlayerOptions: VideoPlayerOptions(), onCacheFileCompleted: (s) { print('onCacheFileCompleted $s'); }, onCacheFileFailed: (f) { print('onCacheFileCompleted $f'); })

Hope these logs will help to solve this issue. Once again thanks for solving the issue I reported yesterday, Thank you!

LecleVietnam commented 1 year ago

Hi @Hackoak, Thank you for your feedback, currently the package doesn't support playing local m3u8 files, it only supports network URLs. However, we will have a research for this issue and if there is any update for the package we will notify you asap and if not we will provide the reason.