tvOS Play/Pause Button & Background music
tvOS Play/Pause Button & Background music
- Subject: tvOS Play/Pause Button & Background music
- From: Liam Bates via Cocoa-dev <email@hidden>
- Date: Fri, 4 Oct 2019 12:11:55 -0700
Hi,
I’m currently making a SpriteKit game in tvOS and am using the Play/Pause
button on the remote as my games secondary button. The code to make this work
is as follows:
let pushPlay = UITapGestureRecognizer(target: self, action:
#selector(pushedPlay))
pushPlay.allowedPressTypes = [NSNumber(value:
UIPress.PressType.playPause.rawValue)]
self.view?.addGestureRecognizer(pushPlay)
This works great, but stops any music from playing in the background from the
Apple Music app. As my game is a card game I would prefer to allow users to
play their own music if they wish to. I’ve noticed this behavior on most Apple
apps on tvOS and wondered if there was any way to override the pausing of music
when the play/pause button is pushed?
Thanks,
Liam
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden