4

I have gone through following link:- https://developer.apple.com/videos/play/wwdc2017/502/?time=362

I have also downloaded demo project from above mentioned link:-https://developer.apple.com/sample-code/wwdc/2017/Interacting-with-Apple-Music-Content.zip

Needed help to clear 2 doubts which i had w.r.t. musickit:-

1. Can we play music videos within our app using musickit?(or do we need AVKit to play videos)

Exp:-

  1. Refer this link:-https://developer.apple.com/documentation/mediaplayer where its mentioned as " protocol MPSystemMusicPlayerController A protocol for playing videos in the Music app (does it mean only default apple music app or our music app)."

    Also we are able to fetch list of music videos using apple music api(src:-https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/AppleMusicWebServicesReference/GetaMusicVideo.html#//apple_ref/doc/uid/TP40017625-CH18-SW1) :-

    GET https://api.music.apple.com/v1/catalog/{storefront}/music-videos/{id}

    but we are only able to get preview url of the video. So how exactly can we play Complete or FULL music video within our app and not apple music app using musickit?

  2. From afore mentioned demo app, refer to MusicPlayerManager.swift file in Controllers section and find following line:-

    let musicPlayerController = MPMusicPlayerController.systemMusicPlayer

    the type of musicPlayerController variable is MPMusicPlayerController & MPSystemMusicPlayerController , so it should be able to play both audio and video files.Also there is a openToPlay(_ queueDescriptor: MPMusicPlayerQueueDescriptor) method in MPSystemMusicPlayerController to play videos but unsure on what to define in MPMusicPlayerQueueDescriptor

2. Is Music Video a media type or is it part of the album

Both in wwdc video as well as in demo app only four media types are defined. From MediaItem.swift file in demo app:-

enum MediaType: String {
    case songs, albums, stations, playlists
}

This confuses me as to what is music video. From wwdc it seems as if music video is part of albums and its relationship to albums can be found here:- https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/AppleMusicWebServicesReference/MusicVideo.html#//apple_ref/doc/uid/TP40017625-CH29-SW1

Please clarify on the above doubts. Any help is appreciated.

Meet
  • 1,196
  • 12
  • 26

0 Answers0