Apple MusicKit JS: how to play full song, instead of preview? - apple-musickit

o/
Configured app, enabled Apple Music subscription, authorized that user in my web app, and whenever I play a song from media queue, I hear only preview playing, not the full song. When I authorize the same way on Apple Music webiste, it plays full song.
I'm developing on localhost, but all cookies and localstorage items are set, so authorization won't pop up after refresh.
Am I missing some magic param I need to pass to API in order to play full song?
Thanks

Related

Spotify's Web Playback SDK - Can users other than the user who created the player listen through the SDK?

I want to create a web app where I use Spotify's Web Playback SDK to create a player and play music in the browser from another Spotify client (e.g. my Spotify app on my phone or Spotify app on my computer) and also enable other users who are on my website to listen to what's being played live.
Is this possible to do through the Web Playback SDK? If not, how would I go about implementing this?
If the playlist is public then you could allow your users to sign into the website to get a Spotify Token you can then use with the Web Playback SDK, since they log into their own Spotify account, should they have one, it will allow them to listen to your Playlist.
However you would need to have additional code / events to ensure they're in the correct track and position. But you could have something to set this, such as something on your machine which publishes the track and position you're at every so often so you can then have it set the current playback track and position in their web player - but that's something you'd have to figure out is possible, but at least to listen to the same Playlist would work.

Detect when user plays music when app is closed

I was wondering if there is a way the app could know if a user started to play music from the Music app or any other source (Spotify etc.). I am trying to do a specific function every time a user plays a song even if my app is not active. Is this even possible? Can I also retrieve the song information?
With AVKit you can make use:
AVAudioSession.sharedInstance().isOtherAudioPlaying
A Boolean value indicating whether another app is currently playing
audio.
Note that this will not work when your app is inactive. You canĀ“t do that and Apple will reject your app. You can only make this check if your app is active.

Can I play Youtube Offline Videos in my App

I am trying to make an video app that will have a button on whose click I can save the video in Youtube offline mode and can play that video from my app.
This might be illegal:
You could use an API like this YoutubeExtractor which allows you to download the videos.
See the original (your question is a duplicate) post
here.

Control Spotify from your own app

I want to put in my app just one PLAY button and when user will press on that button, to play the song directly in Spotify. It will like a controller, so I can switch songs in Spotify from my own app.
Now I created something, but it plays on my own app. Is there any ways to control my music streaming in spotify via my own app?
For example I press "Next song" and it switches in Spotify app to the next song.
I hope I could explain what I want, if not - please ask me
URL Schemes are the only way to communicate between apps. It is not possible to launch non arbitrary apps.
Then you need to use Spotifys API and they do not currently have any support for that.

Can we PLay Youtube audio only inside app?

I am working on an app, where I am required to play the youtube's Audio and Video as well.
I am able to PLay video Using "XCDYouTubeVideoPlayerViewController" available on cocoa controls. (I am getting Youtube url from the backend)
Is there any way , where I can play audio also only inside my app. Because I checked over Internet and stackoverflow, but Couldn't find anything working.
And Is there any way, where the Video or audio can be played at the Back gorund , i.e when I press Home button the vidoe/audio keeps on playing.
All I fund on stack overflow is, that its forbidden, and the chances are your app will be blocked.
Please help, Thanks Again.
Youtube doesn't encourage audio only! here's what they have to say about this.
Your API Client will not, and You will not encourage or create functionality for Your users or other third parties to: "separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API" -Kuan Yong, YouTube API Team
However there's a hacky workaround workaround whereby you can use a hidden UIWebView and play in that.

Resources