betterplayer icon indicating copy to clipboard operation
betterplayer copied to clipboard

Update and fixed BUG java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider

Open tintran-dev opened this issue 2 years ago • 26 comments

  • Update exoplayer version to 2.18.1
  • Update gradle version 7.3.0 support jdk 11 and kotlin 1.6.+
  • Update kotlin version to 1.7.10
  • Fixed error java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider
  • Upgrade compilesdkversion to 33 support for android 12+ run on gradle 7.3.0
  • To use:

better_player:

git:

url: https://github.com/tintran-dev/betterplayer.git

tintran-dev avatar Sep 23 '22 07:09 tintran-dev

Your fix is working here, thank u

GabrielRStabile avatar Sep 27 '22 18:09 GabrielRStabile

works like a charm, thanks! we need to merge that into master

ronbadur avatar Oct 01 '22 09:10 ronbadur

I just came around to this bug and used the git version of the package and when I try to play the video it throws this error. It was working fine before I updated it.

Caused by: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (FlvExtractor, FlacExtractor, WavExtractor, FragmentedMp4Extractor, Mp4Extractor, AmrExtractor, PsExtractor, OggExtractor, TsExtractor, MatroskaExtractor, AdtsExtractor, Ac3Extractor, Ac4Extractor, Mp3Extractor, AviExtractor, JpegExtractor) could read the stream.

image

Nabute avatar Oct 02 '22 22:10 Nabute

I have resolved it.

For future users:

If you face such issue, please provide videoFormat: BetterPlayerVideoFormat.hls, since in my case the video URL was https://streaming_server/path/to/video_,24,36,48,72,108,0p.mp4.urlset/master.m3u8

Nabute avatar Oct 03 '22 20:10 Nabute

I have resolved it.

For future users:

If you face such issue, please provide videoFormat: BetterPlayerVideoFormat.hls, since in my case the video URL was https://streaming_server/path/to/video_,24,36,48,72,108,0p.mp4.urlset/master.m3u8

Yes! We should set the input video format for the player to be able to recognize what standard the video belongs to. EX: .m3u8 is videoFormat: BetterPlayerVideoFormat.hls .mpd is videoFormat: BetterPlayerVideoFormat.dash other set null

tintran-dev avatar Oct 06 '22 03:10 tintran-dev

Is there any solution other than upgrade the gradle, because I can't for now upgrade it

SamerCat avatar Nov 04 '22 09:11 SamerCat

@SamerCat You can clone source: https://github.com/tintran-dev/betterplayer.git to use local package in this your PC and then you can android studio to open folder android in package, edit gradle version back to 7.0.2 in file android/build.gradle: ext.gradleVersion = "7.0.2"

tintran-dev avatar Nov 07 '22 06:11 tintran-dev

Your fix is working here, thank u

JoseBarreto1 avatar Nov 11 '22 19:11 JoseBarreto1

@jhomlala This pr fixes #1116 and #1113. Please merge.

Tha14 avatar Nov 16 '22 16:11 Tha14

Great, thank you so much 🙏🏻❤

@jhomlala Kindly review and merge this one ... 🙏🏻

moazelsawaf avatar Dec 28 '22 23:12 moazelsawaf

  • Update exoplayer version to 2.18.1
  • Update gradle version 7.3.0 support jdk 11 and kotlin 1.6.+
  • Update kotlin version to 1.7.10
  • Fixed error java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider
  • Upgrade compilesdkversion to 33 support for android 12+ run on gradle 7.3.0
  • To use:

better_player:

git:

url: https://github.com/tintran-dev/betterplayer.git

thanks! It is work ok for me.

yfming93 avatar Jan 07 '23 00:01 yfming93

For future users: if this didnt work for u, stop your current debug process and restart from scratch:

  • run flutter clean
  • then run flutter run

greyovo avatar Feb 09 '23 12:02 greyovo

  • Update exoplayer version to 2.18.1
  • Update gradle version 7.3.0 support jdk 11 and kotlin 1.6.+
  • Update kotlin version to 1.7.10
  • Fixed error java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider
  • Upgrade compilesdkversion to 33 support for android 12+ run on gradle 7.3.0
  • To use:

better_player:

git:

url: https://github.com/tintran-dev/betterplayer.git

@tintran-dev getting below error while playing .m3u8 video link on Android devices (like, Android 11, 12 & 13) (URL => https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8)

Playback error com.google.android.exoplayer2.ExoPlaybackException: Source error Caused by: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (FlvExtractor, FlacExtractor, WavExtractor, FragmentedMp4Extractor, Mp4Extractor, AmrExtractor, PsExtractor, OggExtractor, TsExtractor, MatroskaExtractor, AdtsExtractor, Ac3Extractor, Ac4Extractor, Mp3Extractor, AviExtractor, JpegExtractor) could read the stream. Unhandled Exception: PlatformException(VideoError, Video player had error com.google.android.exoplayer2.ExoPlaybackException: Source error, , null)

@tintran-dev help us to solve this.

priyank-dt avatar Mar 17 '23 04:03 priyank-dt

For your information, this issue is still on-going. The fix by @tintran-dev worked. But this must be fixed by @jhomlala at some point please !?

FlatCodeIq avatar Apr 24 '23 20:04 FlatCodeIq

@tintran-dev it is not picking proper hls track for audio after update

Faiyyaz avatar Jul 31 '23 14:07 Faiyyaz

I have merged this alongside more updates to this fork which you can use for now

  better_player:
    git:
      url: 'https://github.com/guyluz11/betterplayer.git'
      ref: 'merge_fixes'

guyluz11 avatar Sep 11 '23 09:09 guyluz11

@guyluz11 Thank you sir you saved me 🫡

developerAkX avatar Nov 05 '23 21:11 developerAkX

Is there any reason why this hasn't been merged yet?

fabioselau077 avatar Nov 26 '23 00:11 fabioselau077

Is there any reason why this hasn't been merged yet?

Because the repo owner is not responding anymore. I have been using titran's fork ever since without issues.

Tha14 avatar Nov 26 '23 00:11 Tha14

Hey @tintran-dev thanks for your fixes, I'm having issues integrating your changes with my project having flutter 2.1.13, is there a way to implement your changes without having to change my flutter version to 3.1.0 please?

I can not upgrade flutter because many packages depend on flutter 2.1.13. Thanks in advance.

ShejaEddy avatar Jan 31 '24 16:01 ShejaEddy

Good forks are everywhere. If the plugin owner doesn't respond anymore, I suggest publishing it as a new pub.dev package using a new name e.g. best_player.

topex-psy avatar Mar 07 '24 09:03 topex-psy

  • Update exoplayer version to 2.18.1
  • Update gradle version 7.3.0 support jdk 11 and kotlin 1.6.+
  • Update kotlin version to 1.7.10
  • Fixed error java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider
  • Upgrade compilesdkversion to 33 support for android 12+ run on gradle 7.3.0
  • To use:

better_player:

git:

url: https://github.com/tintran-dev/betterplayer.git

thank you solve the issue and save my time

pavanlashkari avatar Apr 01 '24 14:04 pavanlashkari