vikram25897 / flutter_cached_video_player

BSD 3-Clause "New" or "Revised" License
95 stars 145 forks source link

Everytime throws exception in IOS and crashes the app on start - v2.0.0-dev.1 #38

Open AbhishekDoshi26 opened 3 years ago

AbhishekDoshi26 commented 3 years ago

Exception:

*** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Duplicate plugin key: FLTVideoPlayerPlugin’
terminating with uncaught exception of type NSException

Package Version: 2.0.0-dev.1

I was initially using 1.0.3 but that suddenly started throwing class not found exception for ExoPlayer.

vikram25897 commented 3 years ago

Remove original video_player package from dependencies.

AbhishekDoshi26 commented 3 years ago

Already done that @vikram25897 ,but whenever I do pod install, it comes back

vikram25897 commented 3 years ago

Try: rm Pubspec.lock rm ios/Podfile.lock flutter packages get cd ios pod install

AbhishekDoshi26 commented 3 years ago

Hi @vikram25897 still didn't work. A pleasant request, can you again change the class name back to CachedVideoPlayer which was there in 1.0.3 and publish new version? We are using this in production application and we are on the verge of releasing on Appstore and Playstore.

Also, this pre-release version feels a bit slow for caching, initially if it took 1s to load video, now it takes 2-3s for the same video

vikram25897 commented 3 years ago

Some other people have also requested this. I'll try to fix that.

AbhishekDoshi26 commented 3 years ago

Thanks. Appreciated. Will also try to make PR if possible.

Also, please take care that it doesn't break the old version. Because when pre-release version was released, 1.0.3 was not working . I assume that might be due to exoplayer changes made by google, but still. As we are using in prod.

AbhishekDoshi26 commented 3 years ago

I do have temporary solution for this. Go to GeneratedRegistarantPlugin file and delete all entries for videoPlayer. but this needs to be done on every build.

Amirala7 commented 3 years ago

Any updates on this ?

AbhishekDoshi26 commented 3 years ago

@Amirala7 this will surely take a bit of time to fix, till that time you can also go with the temporary solution that I mentioned.

fauzipadlaw commented 3 years ago

if you use video_trimmer https://github.com/sbis04/video_trimmer, it uses video_player as its dependency. You can modify it to use cached_video_player v2.0.0-dev.1

Or use the one that I modified https://github.com/fauzipadlaw/video_trimmer

vikram25897 commented 3 years ago

@fauzipadlaw @AbhishekDoshi26 try this PR https://github.com/vikram25897/flutter_cached_video_player/pull/42

AbhishekDoshi26 commented 3 years ago

Okk @vikram25897 Let me check and will update here by EOD. Thanks for the quick work!

AbhishekDoshi26 commented 3 years ago

@vikram25897 Looks good to me now. Can merge the PR and release the new version.

Thank You So Much!

AbhishekDoshi26 commented 3 years ago

@vikram25897 This solution definitely solved the crashing issue. But now if the user spends 20-30 mins watching the video, the player crashes and all the videos go black. This issue isn't there when we had old payer.