HomeiOS DevelopmentXamarin iOS audio and video nonetheless enjoying in backgroud?

Xamarin iOS audio and video nonetheless enjoying in backgroud?


I exploit ISimpleAudioPlayer and Libvlc to play audio and video in Xamarin type venture. However for iOS te audio and the video nonetheless enjoying even when the app is decrease or display is locked. I handle to cease it within the android half through the use of :

protected override void OnDisappearing()
        {
            base.OnDisappearing();
            if (_audioPlayer != null)
            {
                if (_audioPlayer.IsPlaying)
                {
                    _audioPlayer.Cease();
                }
            }
        }

// for video

protected override void OnDisappearing()
        {
            myvideo.MediaPlayer.Cease();

            base.OnDisappearing();
            MessagingCenter.Ship(this, "SetLandscapeModeOff");
            MessagingCenter.Unsubscribe<HomeVideoPage>(this, "SetLandscapeModeOff");
            
        }

my AppDelegate.cs is :

namespace AppTemplateDS.iOS
{
    // The UIApplicationDelegate for the applying. This class is answerable for launching the 
    // Consumer Interface of the applying, in addition to listening (and optionally responding) to 
    // utility occasions from iOS.
    [Register("AppDelegate")]
    public partial class AppDelegate : international::Xamarin.Varieties.Platform.iOS.FormsApplicationDelegate
    {
        //
        // This methodology is invoked when the applying has loaded and is able to run. On this 
        // methodology it is best to instantiate the window, load the UI into it after which make the window
        // seen.
        //
        // You've gotten 17 seconds to return from this methodology, or iOS will terminate your utility.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary choices)
        {
            LibVLCSharpFormsRenderer.Init();

            international::Xamarin.Varieties.Varieties.Init();
            LoadApplication(new App());

            return base.FinishedLaunching(app, choices);
        }

    }
}

Notice : The background mode functionality is deactivated in iOS Xamarin venture.

please assist

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments