-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Managing MPRemoteControlCenter in SRGMediaPlayerController #214
Comments
Hi!
We do not provide any helpers or direct integration for SRG Media Player, as these APIs are entirely separated from Having a look at how we do it in |
I had a quick look at your implementation, which seems based on our old pre-3.0.0 code. This is not why your implementation does not work (ours worked but had some issues), but at least I would recommend you to have a look at how Letterbox service 4.0.0 works. Before I investigate your code further, could you please tell me why you are avoiding Letterbox service in the first place, so that I better understand what you are trying to achieve? This is of course legitimate (we even provide an API to disable control center integration entirely), but I didn’t see in which way your implementation would differ from ours, so I was just asking myself why implementing it yourself was worth the trouble. Thanks in advance for the clarifications. |
Hi,
I thought you got your inspiration from an older version since, as of version 3.0.0, fake command actions are only kept for compatibility with iOS 11 and below, which is not really the case in the code you sent us. To answer your question, all Letterbox code is publicly available on GitHub, so the latest stable version can always be seen on
Great, that means you can (and should) use To implement your own control bar, you need to listen to the playback and media metadata change notifications ( We have a player bar in Play SRG, you can look at its source code for an example. Our player bar does a bit more since we support background video playback and interaction with Google Cast, so it might be better for you to start with a smaller implementation. I also see that we are still cheating by accessing Letterbox internals. You should not have to do that (and neither should we; I'll write a GitHub issue to remove this bit of sorcery). This way you avoid having to integrate with the control center and can benefit from further Letterbox updates regarding control center support directly (e.g. we recently added the ability to seek directly from the control center). Just get in touch with us if you need more help in implementing this feature. Best regards. |
Got it. Just one more question: is there any way I can connect SRG controls (like SRGTimeSlider) to LetterboxControler? Rather then implementing them myself from scratch? |
Sadly, not with an official public way. We have a private property mediaPlayerController on From what you want, you would like to do like All is internal today. We should investigate with @defagos to add a First time a SRG application is asking to do a custom player with the seek bar. Thank you. |
Great idea. Only two controls I'm using are slider and SRGPlaybackButton. |
Hi guys, last question. I need to finish my mini-audio player this week, so if you will not have time to make it I will make my own. Thanks. |
Sorry for the late answer, we were quite busy working on our products. You must do it on your own, sorry. This requires further API discussions from us, and we clearly didn't have the time this week with all the work expected from us. I'll discuss this with our PO so that we can free some time to work on it next sprint. In the meantime, the easiest for you is to cheat like we do in Play, by accessing the Exposing this property publicly would be an option (this would avoid us having to create similar public Letterbox components), and while I might like the idea, I prefer evaluating the risks and rewards with @pyby first. |
OK, no problem, thanks for info. |
I gave some more thought about this issue. I think we should expose the underlying MP controller. This would make KVO registrations possible for many values which should now be KV-observed for changes (e.g. Of course this needs to be properly documented so that people only use the controller for intended purposes. But I don't see API risks, at least not in the same way I saw them in the past. It is clear that if you are using LB all playback methods are on the controller anyway. It is also likely we should then remove LB notifications (e.g. |
Hi guys,
this is more ask for help than issue.
I'm trying to setup MPRemoteControlCenter and nowPlayingInfo in my custom "mini-audio" player view which doesn't use LetterboxService but SRGMediaPlayerController and other SRG components.
I have successfully setup nowPlayingInfo and MPRemote actions but it doesn't work properly: on Lock Screen all buttons are disabled and in control center it usually stops working after first action.
Is there some way how to enable MPRemoteControlCenter events easily for SRGMediaPlayerController? Or is there some trick how to setup MPRemoteControlCenter properly? I studied your code in LetterboxService and tried everything.
Thanks for any suggestion.
I'm attaching my custom view code.
MinimizedAudioPlayerView.zip
The text was updated successfully, but these errors were encountered: