XamarinMediaManager
XamarinMediaManager copied to clipboard
IOS, previous next controls
Hi Martijn this is wonderful work you guys have done. Here is the same problem, I am facing. When the iphne is locked, I cant see the next previous controls. I am attaching two pics, one from one app i am building using mediamanager and second is some idownload app. You can clearly see it doesnt display the next prvious controls, and also few other controls like playlist. This is how I have set the queue.
List<Video> list = new List<Video>();
list.Add(new Video
{
DisplayName = "ElephantsDream",
VideoSource = "https://archive.org/download/ElephantsDream/ed_hd_512kb.mp4"
});
list.Add(new Video
{
DisplayName = "BigBuckBunny",
VideoSource = "https://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4"
});
list.Add(new Video
{
DisplayName = "Sintel",
VideoSource = "https://archive.org/download/Sintel/sintel-2048-stereo_512kb.mp4"
});
list.Add(new Video
{
DisplayName = "Sintel2",
VideoSource = "https://archive.org/download/Sintel/sintel-2048-stereo_512kb.mp4"
});
list.Add(new Video
{
DisplayName = "Mp3",
VideoSource = "https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"
});
await CrossMediaManager.Current.Play(list.Select(a => a.VideoSource).ToList());
Thanks
https://github.com/Baseflow/XamarinMediaManager/issues/735
I think it might not get set automatically at the moment: https://github.com/Baseflow/XamarinMediaManager/blob/develop/MediaManager/Platforms/Apple/Notifications/NotificationManager.cs#L66
Please make a PR to fix that.
Thanks Martinjn but honestly speaking, I have no idea how to fix it, or what to do make it work manually.
Thanks
Call ShowNavigationControls = true to make it work manually i guess. The fix would be to set the property first time as well.
Thanks I am trying, but dont i need to implement MPRemoteCommandCenter CommandCenter = MPRemoteCommandCenter.Shared; defining all these commands. Otherwise how would it know what to do.
Thanks
Mate It doesnt work, with everything changed, it still doent show the next previous controls.
Thanks
First screenshot is from lockscreen notification. Second screenshot is from inside some app? You can't expect that the controls on a lock screen notification matches the controls inside an app. When that's said, the lock screen does support more actions than what is used by MediaManager. MediaManager doesn't support those actions, so you'd have to implement it yourself (possibly in MediaManager and make a PR).
Rene Even the locked screen doesn’t give you next previous buttons. That screenshot was given just to give the idea.
Thanks
On Thu, 10 Sep 2020 at 6:35 am, René Simonsen [email protected] wrote:
First screenshot is from lockscreen notification. Second screenshot is from inside some app? You can't expect that the controls on a lock screen notification matches the controls inside an app. When that's said, the lock screen does support more actions than what is used by MediaManager. MediaManager doesn't support those actions, so you'd have to implement it yourself (possibly in MediaManager and make a PR).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Baseflow/XamarinMediaManager/issues/751#issuecomment-689806933, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA3FKJCZJORTGG553LAETLSE7RH5ANCNFSM4QISJBAA .
-- Regards Paraminder Singh 0405054000
@virk0009 I have achieved this by subclassing the NotificationManager class on my Xamarin iOS project, and overriding the ShowNavigationControls. I wanted to show the next and previous buttons in the control center. Inside the setter, I call base.ShowNavigationControls, but also set the properties of the buttons that I don't want to show, to false. That worked for me.
Hi Janwiebe I also managed to make it work. Setting the properties to false works.
Thanks
@janwiebe-jump @virk0009 can you guys give me some example code to control the NotificationManager on ios xamarin to show the next and prev buttons on notifications? Thanks.
@thanoue This is my Custon NotificationManager
class NotificationManager : MediaManager.Platforms.Apple.Notifications.NotificationManager
{
public override bool ShowNavigationControls
{
get => base.ShowNavigationControls;
set
{
base.ShowNavigationControls = value;
// The base class attaches the commands.
// Just override the settings here (the seeks, and skips, so the next en prev are shown)
CommandCenter.SeekBackwardCommand.Enabled = false;
CommandCenter.SeekForwardCommand.Enabled = false;
CommandCenter.SkipBackwardCommand.Enabled = false;
CommandCenter.SkipForwardCommand.Enabled = false;
// Enable shuffle and repeat.
CommandCenter.ChangeRepeatModeCommand.Enabled = true;
CommandCenter.ChangeShuffleModeCommand.Enabled = true;
}
}
}
And set it like this in your AppDelegate:
CrossMediaManager.Apple.Notification = new NotificationManager();
@thanoue This is my Custon NotificationManager
class NotificationManager : MediaManager.Platforms.Apple.Notifications.NotificationManager { public override bool ShowNavigationControls { get => base.ShowNavigationControls; set { base.ShowNavigationControls = value; // The base class attaches the commands. // Just override the settings here (the seeks, and skips, so the next en prev are shown) CommandCenter.SeekBackwardCommand.Enabled = false; CommandCenter.SeekForwardCommand.Enabled = false; CommandCenter.SkipBackwardCommand.Enabled = false; CommandCenter.SkipForwardCommand.Enabled = false; // Enable shuffle and repeat. CommandCenter.ChangeRepeatModeCommand.Enabled = true; CommandCenter.ChangeShuffleModeCommand.Enabled = true; } } }
And set it like this in your AppDelegate:
CrossMediaManager.Apple.Notification = new NotificationManager();
you mean that there are limit button can be shown on the notification bar right?
According to my findings, yes.
So stupid right LOL? btw, I tried with your code and it works, finally. Thanks so much.
@janwiebe-jump Could you please send me a sample app to customization of notification bar using the media manager plugin?
Thanks in advance.