Play Apple Music through 3rd party app on tvOS? - ios

As we can play apple music songs by third party applications on iOS.
As we know Apple given Apple Music Support on tvOS as well. So is it possible to play Apple Music songs from my tvOS application like iOS
On Apple Documentation here it is clearly said that Apple Music is only possible to play by using MPMusicPlayerController but it seems that Apple haven't given access of MPMusicPlayerController in tvOS
any idea.

Short Answer: No, you are not able to play music from Apple Music in your own apps.
Music Library
MPMusicPlayerController and the rest of the MediaPlayer.framework are a set of classes that allow you to play (and browse) the users Music Library.
The Music Library is actually different to Apple Music, it's the collection of music stored on the users device. This could be music purchased through the iTunes store, songs synced through iTunes on a computer or tracks from Apple Music downloaded to the device for offline playback.
Because the Apple TV isn't a portable device, it doesn't really make sense to have a physical music library on the device (it's permanently connected to the internet) so without a physical music library there is no point giving developers access to it.
This is why MPMusicPlayerController isn't available on tvOS.
Apple Music API
If however you wanted access to an actual Apple Music API (like the one Sonos use), you are also out of luck i'm afraid.
This API allows third parties to connect with the Apple Music platform and allow streaming of music directly from Apple's servers however as far as i've seen, Apple only work with select manufacturers (currently only Sonos that we know of) and it doesn't really make sense for them to open something like that up to the public.
With multitasking and the ability to play Apple Music already on the Apple TV already there isn't really a reason why Apple should need to give developers access to play Apple Music within their own apps.
Own Music
If you actually wanted the ability to play your own music files on tvOS, you could do this using AVAudioPlayer.

The Apple Music API is iOS only and isn't (yet) available for apps written for tvOS.

Related

Showing advertisements in the middle of playing video ios swift

I want to show advertisement while playing video in app like youtube. My app contains videos, while seeing video, in the middle of the video i need to show the advertisement like youtube. I checked with Admob, but i didn't get solution. Anyone having idea of how to do this?
Interactive Media Ads SDKs allows iOS native application developers to request and track VAST ads (ProRol,MidRol,PostRol,Skipable etc) in the iOS (9.0+) environment.
It supports AVPlayer as well.
Here is is complete documentation of IMA SDK

DLNA support for iOS video app

I am developing an video player app on iOS and I am now thinking about how to support DLNA so that my app can mirror its online video to the TV with some DLNA-supported device.
Notice that the online video is playing on my app via WIFI or cellular network and I could switch it to be played on TV and my app becomes a remote control and a server to the TV.
Which framework should I use?
I already know Cyberlink and PlatinumKit.
I have worked on DLNA with iOS and Android device. I did not used the Cyberlink or PlatinumKit. I learned how it works and write with swift and java.
Here is my blog about the subject, if you only want the part of DLNA to find DLNA device and stream the video to the device, then control events like play, pause and seek. You could find all the material you need here.
https://eliyar.biz/DLNA_with_iOS_Android/

How to manage multiple Airplay receivers on iOS?

I want to create an app that can play music from my iOS device to multiple Airplay speakers. I know that MPVolumeView natively lets you do this on 1 Airplay receiver, so that is not the solution I need. There is an iOS app in the store that does this: Whaale.
How do they do it? I am happy to use private APIs, as I do not plan to release this as a public app right now.
While I cannot answer specifically, I can point you to a few things I've discovered:
- There are a few apps that do this for IOS.
- All of them have the limitation that they can only stream music that is not through itunes and that exist on the device as music files.
- no streaming is available (Pandora, Spotify, etc.)
Good Luck!
Robert

AUGraph/AudioUnit support in Rdio iOS SDK

I wanted to develop a iOS music player app by using Rdio streaming service.I have gone through rdio sdk documentation and able to understand the audio playback API's. However along with playback, I would also want to add some of the default apple provided audio effects like equalizers etc to audio stream. I could not find any way to do it so.
Is rdio iOS SDK allow us to add audio effects to its pipeline or is there any other alternative?
The Rdio iOS SDK doesn't let you integrate with AUGraph/AudioUnit. The SDK is designed to work like a blackbox, you specify what to play and music comes out the speakers. This is done to prevent developers from accessing and manipulating the audio.

How to get audio from AppleWatch like Shazam does?

Recently I have realized that Shazam has developed an AppleWatch application but in many questions and answers in StackOverflow, we have talked about the no possibility of recording audio directly from your watch.
Does a new way exist to do it?
The Shazam app simply activates the app on your phone. The WatchKit SDK doesn't allow access to the mic. They mention this in their marketing materials and such.

Resources