MusicKit JS

RSS for tag

Add an Apple Music player to your web app using MusicKit JS.

Posts under MusicKit JS tag

124 Posts

Post

Replies

Boosts

Views

Activity

MusicKit PLAY_ACTIVITY error popups
Often we get the error below when we invoke skipToPreviousItem or skipToNextItem. Can anyone shed any light on what it means or how to fix it? These errors don't seem to actually stop the music playing, so it would be good even if there was a way we could not show the alert popups. It would also be good if anyone knows how to control the kit to make it not show error dialog (like using a try-catch error before it shows)? PLAY_ACTIVITY: A play stop() method was called without a previous play() descriptor Anyone seen this and been able to fix it? Thanks
2
0
2.1k
Dec ’21
Apple Music/Music Kit: how to get song IDs from regular URLs?
The Apple Music API provides a service to fetch a song via an identifier, as detailed in their documentation in this format: https://api.music.apple.com/v1/catalog/us/songs/900032829 However, I noticed that when linking to a song on Apple Music, the link looks like this: https://music.apple.com/us/album/take-on-me-1985-12-mix-2015-remastered/1035047659?i=1035048414 What I am unable to do (unless without using the Spotify API to look up the IRSC code) is to extract the song ID from the regular music URL. What is the best way to do this?
3
0
5.4k
Nov ’21
Use token from “sign in with apple” to query apple music api
Context I am trying to make webservice that fetches the users name and email from his Apple account and place a Song or Artist in his library. For adding a Song to the library I found this apple-music-api. library. To make requests on behalf of a user you need to request a user token with Apple MusicKit JS library. For fetching the name and email of the user I use this oauth2 client that uses the signin with Apple functionality. Problem A Using the apple music kit... I can not query any user profile data. At least I cannot seem to find an example of this. If there is a possibility to get user email and name using this route? B Using the Sign in with Apple oauth flow I receive an access token which contains the name and email. But I cannot use the token to query the apple music api. It seems their scopes are limited to name and email...and no music or something. Is there a possibility to get an user token that can be user on the music api? C Are there any other possibilities to accomplish this without requiring the user to sign in twice on apple (once for the email and once for pushing the Song to his library) PS: I also asked this question on stackoverflow https://stackoverflow.com/questions/67649023/use-token-from-sign-in-with-apple-to-query-apple-music-api
1
0
2.7k
Nov ’21
MusicKit PLAY_ACTIVITY error popups
Often we get the error below when we invoke skipToPreviousItem or skipToNextItem. Can anyone shed any light on what it means or how to fix it? These errors don't seem to actually stop the music playing, so it would be good even if there was a way we could not show the alert popups. It would also be good if anyone knows how to control the kit to make it not show error dialog (like using a try-catch error before it shows)? PLAY_ACTIVITY: A play stop() method was called without a previous play() descriptor Anyone seen this and been able to fix it? Thanks
Replies
2
Boosts
0
Views
2.1k
Activity
Dec ’21
Apple Music/Music Kit: how to get song IDs from regular URLs?
The Apple Music API provides a service to fetch a song via an identifier, as detailed in their documentation in this format: https://api.music.apple.com/v1/catalog/us/songs/900032829 However, I noticed that when linking to a song on Apple Music, the link looks like this: https://music.apple.com/us/album/take-on-me-1985-12-mix-2015-remastered/1035047659?i=1035048414 What I am unable to do (unless without using the Spotify API to look up the IRSC code) is to extract the song ID from the regular music URL. What is the best way to do this?
Replies
3
Boosts
0
Views
5.4k
Activity
Nov ’21
Use token from “sign in with apple” to query apple music api
Context I am trying to make webservice that fetches the users name and email from his Apple account and place a Song or Artist in his library. For adding a Song to the library I found this apple-music-api. library. To make requests on behalf of a user you need to request a user token with Apple MusicKit JS library. For fetching the name and email of the user I use this oauth2 client that uses the signin with Apple functionality. Problem A Using the apple music kit... I can not query any user profile data. At least I cannot seem to find an example of this. If there is a possibility to get user email and name using this route? B Using the Sign in with Apple oauth flow I receive an access token which contains the name and email. But I cannot use the token to query the apple music api. It seems their scopes are limited to name and email...and no music or something. Is there a possibility to get an user token that can be user on the music api? C Are there any other possibilities to accomplish this without requiring the user to sign in twice on apple (once for the email and once for pushing the Song to his library) PS: I also asked this question on stackoverflow https://stackoverflow.com/questions/67649023/use-token-from-sign-in-with-apple-to-query-apple-music-api
Replies
1
Boosts
0
Views
2.7k
Activity
Nov ’21