XamarinMediaManager icon indicating copy to clipboard operation
XamarinMediaManager copied to clipboard

[Forms][UWP] The method or operation is not implemented.

Open ZeProgFactory opened this issue 7 years ago • 19 comments

🔙 Regression

CrossMediaManager.Current.Init(); & CrossMediaManager.Current.Play();

Old (and correct) behavior

Worked without problems

Current behavior

System.NotImplementedException HResult=0x80004001 Message=The method or operation is not implemented. Source=MediaManager StackTrace: at MediaManager.MediaManagerImplementation.Init() at TestMediaManager.UWP.App.OnLaunched(LaunchActivatedEventArgs e) in D:\SoftWare2\Apps\YAMP\R&D\TestMediaManager\TestMediaManager\TestMediaManager.UWP\App.xaml.cs:line 56

Reproduction steps

Create new Xamarin.Forms app add Plugin.MediaManager.Forms 0.5.0 update all Nugets https://github.com/ZeProgFactory/TestMediaManager

Configuration

VS2019 Xamarin.Forms 3.6.0.293080 Plugin.MediaManager.Forms 0.5.0

Platform:

  • [ ] :iphone: iOS
  • [x] :robot: Android
  • [ ] :checkered_flag: WPF
  • [X] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [ ] :monkey: Xamarin.Forms

not checked on the other platforms

ZeProgFactory avatar Apr 12 '19 20:04 ZeProgFactory

Its giving in android too

tonyyyrocks39 avatar Apr 13 '19 05:04 tonyyyrocks39

I don't see you calling Init from the native platform anywhere, so that would be the problem on Android. I'll add something in the readme for this.

About UWP, there are still quite some parts not implemented there, and i need some help to get it done.

martijn00 avatar Apr 13 '19 09:04 martijn00

Perhaps you could put some notes in the wiki for the building process on a PC and/or Mac and how someone may help you? Thanks

ZeProgFactory avatar Apr 13 '19 09:04 ZeProgFactory

@ZeProgFactory Done, see: https://github.com/martijn00/XamarinMediaManager#building-the-source-code

martijn00 avatar Apr 13 '19 10:04 martijn00

I was using like this in Android- protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(savedInstanceState);
        global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
       CrossMediaManager.Current.Init();
        LoadApplication(new App());
    }

tonyyyrocks39 avatar Apr 13 '19 13:04 tonyyyrocks39

this still exists,I installed 0.5.1 in all of the projects,The issue comes up. But works in 0.4.5. Problem with 0.4.5 is ,I am not able to seek or play/pause,but this again works in older version of Xamarin.Forms

tonyyyrocks39 avatar Apr 13 '19 13:04 tonyyyrocks39

Hi ,

could you please fix this .Because this entire library was very good,but now it is nothing for use as in 0.5.1-Gives not implemented exception 0.5.0-same 0.4.5-Cant play/resume or current value change not working in Android,not checked in ios

Thanks, Tony

tonyyyrocks39 avatar Apr 14 '19 04:04 tonyyyrocks39

Not sure ..whether this is actually fixed or not,I am still getting error. 1.Created a new project in Xamarin.Forms(.Net standard), As of now only a PCL library and Xamarin.Android Project 2.Added only one line code for initialization in mainactivity- CrossMediaManager.Current.Init();

3.Targeted to Android 9.0 and minimum is Android 5.0 3.After building it is giving same exception

Attached project file for reference- https://drive.google.com/open?id=17biZk19HPzxUq2QqPbHV6H2Mo9OoB0Hq (Need to clean and rebuild)

tonyyyrocks39 avatar Apr 16 '19 03:04 tonyyyrocks39

I have this problem too, with 0.5.3 version. iOS is ok. Android version is not ok.

If it finds a CrossMediaManager.Current.Init() on Android MainActivity or in main Forms App.xaml.cs or in a View that uses a Current.Play, every time it says that Current is not implemented in the portable version of this assembly. You should reference the NuGet Package from your main application project in order to reference the platform-specific implementation.

at MediaManager.CrossMediaManager.get_Current () [0x0000d] in C:\Users\mhvdi\Documents\OpenSource\XamarinMediaManager\MediaManager\CrossMediaManager.cs:27

There are some break changes since 5.0 version too... like this:

CrossMediaManager.Current.PlayingChanged += (sender, e)

the e is different now and doesn't have e.Progress (double), only e.Duration and e.Position (TimeStamp). I'm trying to find samples about using PlayingChanged event to control audio progress.

eternalbard avatar Apr 16 '19 18:04 eternalbard

/// <summary>
        /// Current plugin implementation to use
        /// </summary>
        public static IMediaManager Current
        {
            get
            {
                IMediaManager ret = implementation.Value;
                if (ret == null)
                {
                    throw NotImplementedInReferenceAssembly();
                }
                return ret;
            }
        }

😱

eternalbard avatar Apr 16 '19 19:04 eternalbard

Try 0.5.7

martijn00 avatar May 16 '19 19:05 martijn00

same thing on 0.97

abjelosevic avatar May 07 '20 03:05 abjelosevic

Tested on 0.98 alpha and have the same problem.

AndyPresto avatar May 27 '20 12:05 AndyPresto

@AndyPresto you need to target the correct minimum version of UWP: 10.0.17763.0.

martijn00 avatar May 27 '20 12:05 martijn00

Hello, same issue persists in Android on version 1.0.3. Target android version is api 28, minimum is api 21.

Is this planned to be fixed? Or different initialization instructions exist now?

I'm calling,

CrossMediaManager.Current.Init();

to initialize, in both Android and iOS projects.

ylankovs avatar Sep 17 '20 02:09 ylankovs

Stop asking for a fix. This is not a problem or a bug! It's your own fault! Update your target to the latest!

martijn00 avatar Sep 17 '20 08:09 martijn00

Then update the documentation. It specifically says target android api 28.

There are many posts referring to the issue persisting while targeting android api 29, obviously people are posting because there might be some issues?

I've downgraded to 0.9.0 of the plugin, and the issue is gone. So your 'it's your own fault' is actually your fault for lacking to update the documentation accordingly.

ylankovs avatar Sep 17 '20 08:09 ylankovs

Wow, that is one big insulting comment. Why didn't you make a PR to update the documentation to v29? You made a grant total of 12 open source commits in your lifetime. I have tens of successful open source projects with thousands of commits every year. Have some respect, or start paying for your free software.

martijn00 avatar Sep 17 '20 08:09 martijn00

Assuming that my life is spent on github, is a big mistake. But throwing around accusations is some big boy stuff. Cheers

ylankovs avatar Sep 17 '20 08:09 ylankovs