Giter Site home page Giter Site logo

Comments (6)

szurgot avatar szurgot commented on May 27, 2024 1

This is happening because the service is never set to Foreground which is due to the initialization of the PlayerNotificationManager is happening incorrectly. The PlayerNotificationManager is being built on line 118. but one of it's parameters isn't is null when it's invoked: https://github.com/Baseflow/XamarinMediaManager/blob/develop/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs#L118

Since the NotificationListener is properly constructed on the next line, switching those two lines will resolve the problem.

from xamarinmediamanager.

copang avatar copang commented on May 27, 2024

@ArchangelWTF @janwiebe-jump can you help me?

from xamarinmediamanager.

arahmancsd avatar arahmancsd commented on May 27, 2024

same here. I noticed the app is crashing/closing after 10-15 mins when the app is in the background/foreground.

from xamarinmediamanager.

efhayati avatar efhayati commented on May 27, 2024

Same issue here. It woks fine when the phone is charging, but otherwise after 2-3 minutes the audio stops. I'm trying to play an stream.

Platform: Android (Android 13)
MAUI (.net 7)
Plugin.MediaManager 1.2.2

from xamarinmediamanager.

sandreas avatar sandreas commented on May 27, 2024

Maybe you need to aquire a wifi lock to support streaming content.

https://github.com/jamesmontemagno/AndroidStreamingAudio/blob/master/Part%202%20-%20Lock%20Screen/Services/StreamingBackgroundService.cs

from xamarinmediamanager.

ikeremozcan avatar ikeremozcan commented on May 27, 2024

Android devices has battery optimization settings for the apps. Could you try to get this permission and see that's work for you.
if (Build.VERSION.SdkInt >= BuildVersionCodes.M) { String? packageName = Platform.CurrentActivity?.PackageName; Android.Content.Intent intent = new Android.Content.Intent(); intent.SetAction(Android.Provider.Settings.ActionRequestIgnoreBatteryOptimizations); intent.SetData(Android.Net.Uri.Parse("package:" + packageName)); Platform.CurrentActivity?.StartActivity(intent); }

Also add this to manifest
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

from xamarinmediamanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.