Baseflow / ExoPlayerXamarin

Xamarin bindings library for the Google ExoPlayer library
https://baseflow.com
MIT License
152 stars 67 forks source link

MonoAndroid bindings issues: IMediaSourceFactory and DownloadService #150

Closed ivs88 closed 1 year ago

ivs88 commented 1 year ago

🔙 Regression

Hi, I've found couple issues in the latest MonoAndroid 12.0 build 2.18.9-xamarin.1

  1. Media source factory classes (DefaultMediaSourceFactory, ProgressiveMediaSource.Factory, etc) don't implement IMediaSourceFactory interface. So you can't properly initialize ExoPlayer.
  2. I've tried to use DownloadService and it throws excpetion "has no zero argument constructor". I'm not sure what's wrong, tried all variations of constructors with no luck. To reproduce this you can subclass DownloadService, add dummy implementation for missing members, add default constructor and call StartService().
  3. DownloadService is missing ACTION_RESTART constant

Version: 2.18.9-xamarin.1

Platform:

martijn00 commented 1 year ago

The nuget you are referencing is not an official nuget by me. Also MonoAndroid is deprecated.

ivs88 commented 1 year ago

The nuget you are referencing is not an official nuget by me. Also MonoAndroid is deprecated.

@martijn00 Sorry, I saw recent activity in #145 and thought it's a good place. But FYI: I think issues 2 and 3 are also happening in your nuget.

@janwiebe-jump do you have any plans on supporting MonoAndroid? If yes, could you take a look at issues above?

martijn00 commented 1 year ago

https://www.nuget.org/packages/Xam.Plugins.Android.ExoPlayer/2.18.9-xamarin.1

I've added a Xamarin based nuget too now. Please open a PR to fix any binding errors so i can update this.

ivs88 commented 1 year ago

@martijn00 Thanks, I've tried 2.18.9-xamarin.1 and it has same issues I've described above (except WorkManager package version, removed that from description). Would you like to reopen this ticket?

martijn00 commented 1 year ago

I have no time to work on fixing this myself, but am open to PR's. Please open one for this, or maybe @janwiebe-jump or @ArchangelWTF can do it?

ivs88 commented 1 year ago

I figured out the 2nd, it turns out that missing constructor is a general xamarin bindings limitation and the workaround would be to use ExportAttribute https://learn.microsoft.com/en-us/xamarin/android/internals/limitations#missing-constructors

jonathanantoine commented 5 months ago

Hello, this issue is now still happening on the official monodroid package ? Can it be re opened ?

jonathanantoine commented 5 months ago

@martijn00 I have made a Pull request but I am not sure if I have to bump the version.

https://github.com/Baseflow/ExoPlayerXamarin/pull/182