Hey There,
While I've been able to get the currently playing song to continue
playing while the App is in the background by adding the right to key
to my info-plist, the system wide play/pause (when double clicking the
home button and swiping to reveal the left mulittasking menu) do not
change to my app's controls. There's also no clear callbacks to the
app that allow for a new song to be queued up.
Apple's audio session guide is all described by using AVFoundation
and the AVPlayer, but it doesn't appear that RDPlayer is a subclass of
AVPlayer. Is it possible to implement the above two features? Is
there a piece of documentation that I should look at to understand how
to be able to play a new song while still in the background
specifically?
On Fri, Jun 8, 2012 at 8:22 AM, Rahul kishore <rahul.kish...@gmail.com> wrote:
> Apple's audio session guide is all described by using AVFoundation
> and the AVPlayer, but it doesn't appear that RDPlayer is a subclass of
> AVPlayer.
You are correct, at this time RDPlayer does not use AVPlayer of
AVFoundation. It currently uses the Audio Toolbox portion of Core
Audio.
> Is it possible to implement the above two features? Is
> there a piece of documentation that I should look at to understand how
> to be able to play a new song while still in the background
> specifically?
I'll dig in deeper and figure out if this is possible using Audio
Toolbox or if I would need to switch to AVPlayer. Stay tuned.
On Saturday, June 9, 2012 3:25:31 AM UTC+5:30, Devin S. wrote:
> On Fri, Jun 8, 2012 at 8:22 AM, Rahul kishore <rah...ore@..mail.com> > wrote: > > Apple's audio session guide is all described by using AVFoundation > > and the AVPlayer, but it doesn't appear that RDPlayer is a subclass of > > AVPlayer.
> You are correct, at this time RDPlayer does not use AVPlayer of > AVFoundation. It currently uses the Audio Toolbox portion of Core > Audio.
> > Is it possible to implement the above two features? Is > > there a piece of documentation that I should look at to understand how > > to be able to play a new song while still in the background > > specifically?
> I'll dig in deeper and figure out if this is possible using Audio > Toolbox or if I would need to switch to AVPlayer. Stay tuned.
You must have missed the announcement earlier this month about the updated iOS SDK. Much better queue management in this new version. Check out the updated documentation at:
> Any update on this? I too need to change the song playing in the background.
> Right now the currently playing song plays in background but the app does not play more songs after the first song ends playback.
> On Saturday, June 9, 2012 3:25:31 AM UTC+5:30, Devin S. wrote:
> On Fri, Jun 8, 2012 at 8:22 AM, Rahul kishore <rah...ore@..mail.com> wrote: > > Apple's audio session guide is all described by using AVFoundation > > and the AVPlayer, but it doesn't appear that RDPlayer is a subclass of > > AVPlayer.
> You are correct, at this time RDPlayer does not use AVPlayer of > AVFoundation. It currently uses the Audio Toolbox portion of Core > Audio.
> > Is it possible to implement the above two features? Is > > there a piece of documentation that I should look at to understand how > > to be able to play a new song while still in the background > > specifically?
> I'll dig in deeper and figure out if this is possible using Audio > Toolbox or if I would need to switch to AVPlayer. Stay tuned.
> -- > Devin Sevilla > API Engineer, Rdio Inc.
> -- > You received this message because you are subscribed to the Google Groups "Rdio API" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rdio-api/-/tcYbRQKnnKAJ.
> To post to this group, send email to rdio-api@googlegroups.com.
> To unsubscribe from this group, send email to rdio-api+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rdio-api?hl=en.
Thanks for your reply and i am currently playing with the new SDK but unable to implement the feature i want.
If possible, can you give me a general overview about how would i go about changing the song while the app is in background with the new SDK version? I do have a list of track keys to be played (4) but i want to be able to not only change the track when one track finishes playing but also load new tracks when the queue is about to get empty.
On Monday, June 18, 2012 11:47:22 PM UTC+5:30, andy wrote:
> You must have missed the announcement earlier this month about the updated > iOS SDK. Much better queue management in this new version. Check out the > updated documentation at:
> On Jun 18, 2012, at 2:06 PM, Chintan Patel wrote:
> > Any update on this? I too need to change the song playing in the > background.
> > Right now the currently playing song plays in background but the app > does not play more songs after the first song ends playback.
> > On Saturday, June 9, 2012 3:25:31 AM UTC+5:30, Devin S. wrote: > > On Fri, Jun 8, 2012 at 8:22 AM, Rahul kishore <rah...ore@..mail.com> > wrote: > > > Apple's audio session guide is all described by using AVFoundation > > > and the AVPlayer, but it doesn't appear that RDPlayer is a subclass of > > > AVPlayer.
> > You are correct, at this time RDPlayer does not use AVPlayer of > > AVFoundation. It currently uses the Audio Toolbox portion of Core > > Audio.
> > > Is it possible to implement the above two features? Is > > > there a piece of documentation that I should look at to understand how > > > to be able to play a new song while still in the background > > > specifically?
> > I'll dig in deeper and figure out if this is possible using Audio > > Toolbox or if I would need to switch to AVPlayer. Stay tuned.
> > -- > > Devin Sevilla > > API Engineer, Rdio Inc.
> > -- > > You received this message because you are subscribed to the Google > Groups "Rdio API" group. > > To view this discussion on the web visit > https://groups.google.com/d/msg/rdio-api/-/tcYbRQKnnKAJ. > > To post to this group, send email to rdio-api..egroups.com. > > To unsubscribe from this group, send email to > rdio-api+unsubscrib...ooglegroups.com. > > For more options, visit this group at > http://groups.google.com/group/rdio-api?hl=en.
Happy to help. It sounds like our apps are fairly similar… here's what I'm doing in rrrrradio, the app I maintain:
1) When the stream starts, I call the RDPlayer:playSources: method with an array of tracks I want to play.
2) Every minute or so, I check a web site that I maintain that keeps an ongoing list of tracks to play, and I load them into an NSArray.
3) I find the index of the currently playing track in this array, and then call the RDPlayer:updateQueue:withCurrentTrackIndex: method. This is the key. This method basically takes the NSArray of tracks you pass to it and updates its own internal queue with new tracks it finds in that list. The player continues playing whatever it was already playing without any interruption. As you can see from the documentation (http://www.rdio.com/media/static/developer/ios/docs/interface_r_d_pla...) it does require you to know the index of the currently playing song. If you don't pass that in properly, you'll see an warning about it in the debug area of Xcode.
If what you're trying to do is *stop* playing the current song and move on to a different one while your app is in the background, your process will be similar. You can use the RDPlayer:updateQueue:withCurrentTrackIndex: method to update the queue so that the song you want to play comes up next, and then call the RDPlayer:next method to advance the player to the next track.
> Thanks for your reply and i am currently playing with the new SDK but unable to implement the feature i want.
> If possible, can you give me a general overview about how would i go about changing the song while the app is in background with the new SDK version? I do have a list of track keys to be played (4) but i want to be able to not only change the track when one track finishes playing but also load new tracks when the queue is about to get empty.
> Right now i am not able to accomplish either.
> Any help will be much appreciated.
> On Monday, June 18, 2012 11:47:22 PM UTC+5:30, andy wrote:
> You must have missed the announcement earlier this month about the updated iOS SDK. Much better queue management in this new version. Check out the updated documentation at:
> On Jun 18, 2012, at 2:06 PM, Chintan Patel wrote:
> > Any update on this? I too need to change the song playing in the background.
> > Right now the currently playing song plays in background but the app does not play more songs after the first song ends playback.
> > On Saturday, June 9, 2012 3:25:31 AM UTC+5:30, Devin S. wrote: > > On Fri, Jun 8, 2012 at 8:22 AM, Rahul kishore <rah...ore@..mail.com> wrote: > > > Apple's audio session guide is all described by using AVFoundation > > > and the AVPlayer, but it doesn't appear that RDPlayer is a subclass of > > > AVPlayer.
> > You are correct, at this time RDPlayer does not use AVPlayer of > > AVFoundation. It currently uses the Audio Toolbox portion of Core > > Audio.
> > > Is it possible to implement the above two features? Is > > > there a piece of documentation that I should look at to understand how > > > to be able to play a new song while still in the background > > > specifically?
> > I'll dig in deeper and figure out if this is possible using Audio > > Toolbox or if I would need to switch to AVPlayer. Stay tuned.
> > -- > > Devin Sevilla > > API Engineer, Rdio Inc.
> > -- > > You received this message because you are subscribed to the Google Groups "Rdio API" group. > > To view this discussion on the web visit https://groups.google.com/d/msg/rdio-api/-/tcYbRQKnnKAJ. > > To post to this group, send email to rdio-api..egroups.com. > > To unsubscribe from this group, send email to rdio-api+unsubscrib...ooglegroups.com. > > For more options, visit this group at http://groups.google.com/group/rdio-api?hl=en.
> -- > You received this message because you are subscribed to the Google Groups "Rdio API" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rdio-api/-/FANaKxIz6EsJ.
> To post to this group, send email to rdio-api@googlegroups.com.
> To unsubscribe from this group, send email to rdio-api+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rdio-api?hl=en.
On Wednesday, June 20, 2012 12:59:29 AM UTC+5:30, andy wrote:
> Happy to help. It sounds like our apps are fairly similar… here's what I'm > doing in rrrrradio, the app I maintain:
> 1) When the stream starts, I call the RDPlayer:playSources: method with an > array of tracks I want to play. > 2) Every minute or so, I check a web site that I maintain that keeps an > ongoing list of tracks to play, and I load them into an NSArray. > 3) I find the index of the currently playing track in this array, and then > call the RDPlayer:updateQueue:withCurrentTrackIndex: method. This is the > key. This method basically takes the NSArray of tracks you pass to it and > updates its own internal queue with new tracks it finds in that list. The > player continues playing whatever it was already playing without any > interruption. As you can see from the documentation (
> http://www.rdio.com/media/static/developer/ios/docs/interface_r_d_pla...) > it does require you to know the index of the currently playing song. If you > don't pass that in properly, you'll see an warning about it in the debug > area of Xcode.
> If what you're trying to do is *stop* playing the current song and move on > to a different one while your app is in the background, your process will > be similar. You can use the RDPlayer:updateQueue:withCurrentTrackIndex: > method to update the queue so that the song you want to play comes up next, > and then call the RDPlayer:next method to advance the player to the next > track.
> Hope that helps!
> On Jun 19, 2012, at 3:21 PM, Chintan Patel wrote:
> > Andy,
> > Thanks for your reply and i am currently playing with the new SDK but > unable to implement the feature i want.
> > If possible, can you give me a general overview about how would i go > about changing the song while the app is in background with the new SDK > version? I do have a list of track keys to be played (4) but i want to be > able to not only change the track when one track finishes playing but also > load new tracks when the queue is about to get empty.
> > Right now i am not able to accomplish either.
> > Any help will be much appreciated.
> > On Monday, June 18, 2012 11:47:22 PM UTC+5:30, andy wrote: > > You must have missed the announcement earlier this month about the > updated iOS SDK. Much better queue management in this new version. Check > out the updated documentation at:
> > On Jun 18, 2012, at 2:06 PM, Chintan Patel wrote:
> > > Any update on this? I too need to change the song playing in the > background.
> > > Right now the currently playing song plays in background but the app > does not play more songs after the first song ends playback.
> > > On Saturday, June 9, 2012 3:25:31 AM UTC+5:30, Devin S. wrote: > > > On Fri, Jun 8, 2012 at 8:22 AM, Rahul kishore <rah...ore@..mail.com> > wrote: > > > > Apple's audio session guide is all described by using AVFoundation > > > > and the AVPlayer, but it doesn't appear that RDPlayer is a subclass > of > > > > AVPlayer.
> > > You are correct, at this time RDPlayer does not use AVPlayer of > > > AVFoundation. It currently uses the Audio Toolbox portion of Core > > > Audio.
> > > > Is it possible to implement the above two features? Is > > > > there a piece of documentation that I should look at to understand > how > > > > to be able to play a new song while still in the background > > > > specifically?
> > > I'll dig in deeper and figure out if this is possible using Audio > > > Toolbox or if I would need to switch to AVPlayer. Stay tuned.
> > > -- > > > Devin Sevilla > > > API Engineer, Rdio Inc.