I have old ScreenCaptureKit sample downloaded on Oct 2022.
That sample worked on Oct 2022. But it does not work on Apr 2024 on Sonoma 14.4.1 M1 MacBook. It only shows black screen.
I also download updated ScreenCaptureKit sample and test it. It works on Sonoma 14.4.1 M1 MacBook. I noticed latest sample have SCContentSharingPicker and other changes.
I have my screen capture application based on old ScreenCaptureKit sample. My app only shows black screen.
Do I have to add SCContentSharingPicker and SCContentSharingPickerObserver on my application for capturing screen on Sonoma?
Old way of screen capture without SCContentSharingPicker is not supported anymore on Sonoma?
General
RSS for tagExplore the integration of media technologies within your app. Discuss working with audio, video, camera, and other media functionalities.
Post
Replies
Boosts
Views
Activity
I am using below commad line to generate AES-128 HLS,
mediafilesegmenter -iso-fragmented --encrypt-key-file=my.key -S -f /Volumes/Samsung/pattern/vision_pro/hls/*** /Volumes/Samsung/pattern/vision_pro/***.mov
but it always generates SAMPLE-AES, even I removed -S
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="enc.key",IV=0x7316166d6a85f56f3d4606eaebc3aa44
How I can generate AES-128 HLS? Thanks.
Is it possible to edit the Grouping of a song from the user's library using the Apple Music API?
According to what I read from the documentation, this is not possible, but this is something that I really would love, so, I better ask.
Thanks in advanced!
Link sanbox: https://codesandbox.io/p/sandbox/webrtc-ios-lasted-issue-jzx9h5
Issue: Black video screen when url changed.
Reproduce step:
Get the source code on sanbox repo above
Install packages by command "npm install"
Start local web-app under https by command "HTTPS=true npm start"
Update url by click button "Update URL search param"
OS: iOS v17.4.1
Browser: Safari
Device: iPhone 11 pro
Anyone can help?
Note: it's works on iPhone X iOS version 16
Link video issue: https://streamable.com/rj07u8
Issue: WebRTC - User medias - Black video screen when url changed.
Reproduce step:
Get the source code on sanbox repo above
Install packages by command "npm install"
Start local web-app under https by command "HTTPS=true npm start"
Update url by click button "Update URL search param"
OS: iOS v17.4.1
Browser: Safari Device:
iPhone 11 pro
Anyone can help?
Note: it's works on iPhone X iOS version 16
Link video issue: https://streamable.com/rj07u8
I have the conflict when i use replaykit. There is other app or system use the recording. I want my app can recognize them and let them use the replaykit preferentially.
Could some tell what the relevant endpoint is for fetching all public list of a user playlist. I am able to fetch a one via the id but i want to fetch all in a single request without using authorization.
Hello,
Problem
I am having the exact same issue as described here : https://forums.developer.apple.com/forums/thread/693310
From my understanding of the answers on this topic, it appears to be a problem on the Server Side.
Is it still the case or perhaps I am missing something ?
Here are the curl commands and their outputs :
Storefront call
➜ ~ curl -v -H 'Authorization: Bearer [VALID TOKEN]' "https://api.music.apple.com/v1/storefronts/us"
* Trying [2a02:26f0:2b00:3ab::2a1]:443...
* Connected to api.music.apple.com (2a02:26f0:2b00:3ab::2a1) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
* CAfile: /etc/ssl/cert.pem
* CApath: none
* [CONN-0-0][CF-SSL] (304) (OUT), TLS handshake, Client hello (1):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Server hello (2):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Unknown (8):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Certificate (11):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, CERT verify (15):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Finished (20):
* [CONN-0-0][CF-SSL] (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2
* Server certificate:
* subject: businessCategory=Private Organization; jurisdictionCountryName=US; jurisdictionStateOrProvinceName=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; CN=itunes.apple.com
* start date: Jan 23 20:23:43 2024 GMT
* expire date: Jul 21 20:33:43 2024 GMT
* subjectAltName: host "api.music.apple.com" matched cert's "api.music.apple.com"
* issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 2 - G1
* SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* h2h3 [:method: GET]
* h2h3 [:path: /v1/storefronts/us]
* h2h3 [:scheme: https]
* h2h3 [:authority: api.music.apple.com]
* h2h3 [user-agent: curl/7.87.0]
* h2h3 [accept: */*]
* h2h3 [authorization: Bearer [VALID TOKEN]]
* Using Stream ID: 1 (easy handle 0x12680a800)
> GET /v1/storefronts/us HTTP/2
> Host: api.music.apple.com
> user-agent: curl/7.87.0
> accept: */*
> authorization: Bearer [VALID TOKEN]
>
< HTTP/2 200
< server: daiquiri/5
< content-type: application/json;charset=utf-8
< x-apple-jingle-correlation-key: QZSH3IR75IPQYS7LSN5C5EUJRI
< x-apple-request-uuid: 86647da2-3fea-1f0c-4beb-937a2e92898a
< b3: 86647da23fea1f0c4beb937a2e92898a-1d7eb7b8ad18bc4d
< x-b3-traceid: 86647da23fea1f0c4beb937a2e92898a
< x-b3-spanid: 1d7eb7b8ad18bc4d
< apple-seq: 0.0
< apple-tk: false
< apple-originating-system: MZStorePlatform
< x-apple-application-site: MR22
< x-apple-application-instance: 3588504
< x-responding-instance: MZStorePlatform:3588504:::
< apple-timing-app: 4 ms
< access-control-allow-origin: *
< strict-transport-security: max-age=31536000; includeSubDomains
< x-daiquiri-instance: daiquiri:11896006:mr84p00it-qujn09092102:7987:24RELEASE93:daiquiri-amp-store-l7shared-int-001-mr
< x-daiquiri-instance: daiquiri:12282002:mr47p00it-qujn07081302:7987:24RELEASE93:daiquiri-amp-store-l7shared-ext-001-mr
< cache-control: public, no-transform, max-age=2625
< date: Tue, 23 Apr 2024 14:08:00 GMT
< content-length: 276
< x-cache: TCP_REFRESH_MISS from a2-17-114-29.deploy.akamaitechnologies.com (AkamaiGHost/11.4.5-55391218) (S)
< x-cache-remote: TCP_HIT from a2-17-114-18.deploy.akamaitechnologies.com (AkamaiGHost/11.4.5-55391218) (-)
< vary: Accept-Encoding
< vary: Accept-Encoding
<
* Connection #0 to host api.music.apple.com left intact
{"data":[{"id":"us","type":"storefronts","href":"/v1/storefronts/us","attributes":{"supportedLanguageTags":["en-US","es-MX","ar","ru","zh-Hans-CN","fr-FR","ko","pt-BR","vi","zh-Hant-TW"],"explicitContentPolicy":"allowed","name":"United States","defaultLanguageTag":"en-US"}}]}%
Album call
➜ ~ curl -v -H 'Authorization: Bearer [VALID TOKEN]' "https://api.music.apple.com/v1/catalog/us/albums/310730204"
* Trying [2a02:26f0:2b00:3ab::2a1]:443...
* Connected to api.music.apple.com (2a02:26f0:2b00:3ab::2a1) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
* CAfile: /etc/ssl/cert.pem
* CApath: none
* [CONN-0-0][CF-SSL] (304) (OUT), TLS handshake, Client hello (1):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Server hello (2):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Unknown (8):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Certificate (11):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, CERT verify (15):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Finished (20):
* [CONN-0-0][CF-SSL] (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2
* Server certificate:
* subject: businessCategory=Private Organization; jurisdictionCountryName=US; jurisdictionStateOrProvinceName=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; CN=itunes.apple.com
* start date: Jan 23 20:23:43 2024 GMT
* expire date: Jul 21 20:33:43 2024 GMT
* subjectAltName: host "api.music.apple.com" matched cert's "api.music.apple.com"
* issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 2 - G1
* SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* h2h3 [:method: GET]
* h2h3 [:path: /v1/catalog/us/albums/310730204]
* h2h3 [:scheme: https]
* h2h3 [:authority: api.music.apple.com]
* h2h3 [user-agent: curl/7.87.0]
* h2h3 [accept: */*]
* h2h3 [authorization: Bearer [VALID TOKEN]]
* Using Stream ID: 1 (easy handle 0x148010a00)
> GET /v1/catalog/us/albums/310730204 HTTP/2
> Host: api.music.apple.com
> user-agent: curl/7.87.0
> accept: */*
> authorization: Bearer [VALID TOKEN]
>
< HTTP/2 500
< server: daiquiri/5
< content-type: application/json; charset=utf-8
< content-length: 42
< access-control-allow-origin: *
< x-apple-jingle-correlation-key: EABGYDVEO5AFSK47FMXBMUMODY
< x-apple-application-site: st
< strict-transport-security: max-age=31536000; includeSubDomains
< x-daiquiri-instance: daiquiri:42282002:st53p00it-qujn13050102:7987:24RELEASE93:daiquiri-amp-store-l7shared-ext-001-st
< date: Tue, 23 Apr 2024 14:08:03 GMT
< x-cache: TCP_MISS from a2-17-114-29.deploy.akamaitechnologies.com (AkamaiGHost/11.4.5-55391218) (-)
<
* Connection #0 to host api.music.apple.com left intact
{"message":"An unexpected error occurred"}%
Am I missing something ? Is it a server side issue ? If so, when will it be fixed ? Otherwise, what is wrong with my approach ?
Hi,
Is it possible to get the various audio variants for a given song ID, I am unable to find any documentation for this online. In particular, could I see if Dolby Atmos is available for the track?
Here is an example of a request I am sending: https://api.music.apple.com/v1/catalog/us/songs/1168770969
I have an image viewing app with support for avif (and avis) images. I'm trying to figure out if the recent bug in CoreMedia (dav1d) affects my app. The apple security update: https://support.apple.com/en-gb/HT214097
The vulnerable code path in dav1d is only reached when c->n_fc > 1 (https://code.videolan.org/videolan/dav1d/-/blob/2b475307dc11be9a1c3cc4358102c76a7f386a51/src/decode.c#L2845), where c is the dav1d context.
With some reverse engineering, the way I see CMPhoto calling into VideoToolBox (which internally calls into AV1SW.videodecoder, which is a wrapper around dav1d), the max frame delay is hardcoded to 1 in the dav1d settings which intern means that c->n_fc in dav1d is always 1. The vulnerable code path in dav1d is only reached when c->n_fc > 1 (https://code.videolan.org/videolan/dav1d/-/blob/2b475307dc11be9a1c3cc4358102c76a7f386a51/src/decode.c#L2845).
From my understand, this should mean that my app isn't affected. The apple security update however clearly mentions that "Processing an image may lead to arbitrary code execution". Surely I'm missing something?
Some users of our app get a black screen when playing mp4 files on their phones. The users are all running iOS 17.3.1 and cannot catch the error message when playing a black screen.
The user can play the video normally after restarting the mobile phone. However, we want to solve this problem from the code.
We use two Avplayers to complete the sequential playback of multiple videos.
override init(frame: CGRect) {
super.init(frame: frame)
layer.addSublayer(videoPlayerA)
layer.addSublayer(videoPlayerB)
}
lazy var layers = [videoPlayerA, videoPlayerB]
lazy var videoPlayerA: AVPlayerLayer = {
let avPlayerLayer = AVPlayerLayer(player: AVPlayer())
avPlayerLayer.contentsScale = UIScreen.main.scale
avPlayerLayer.videoGravity = .resizeAspectFill
return avPlayerLayer
}()
lazy var videoPlayerB: AVPlayerLayer = {
let avPlayerLayer = AVPlayerLayer(player: AVPlayer())
avPlayerLayer.contentsScale = UIScreen.main.scale
avPlayerLayer.videoGravity = .resizeAspectFill
return avPlayerLayer
}()
func play() {
if let path = paths[safe: currentIndex] {
currentVideoPath = path
currentPlayer = AVPlayer(playerItem: AVPlayerItem(url: URL(fileURLWithPath: path)))
layers.first?.player?.pause()
layer.insertSublayer(layers.first ?? AVPlayerLayer(), below: layers.last)
layers.swapAt(0, 1)
layers.first?.player = currentPlayer
layers.first?.player?.play()
SHPlayerGlobalStatus.sharedInstance.isLocalPlayerPlaying = true
try? AVAudioSession.sharedInstance().setCategory(.playback)
try? AVAudioSession.sharedInstance().setActive(true)
}
In SwiftUI there is a built-in component for displaying album artworks called Artwork but there is no equivalent for UIKit.
My current approach is to use the .url() method to read image's URL and download the image or read it from the disk but the performance is much worse than it was previously with MPMediaItem's artworkImage method.
let artworkQueue = DispatchQueue(
label: "MusicKit-ArtworkQueue",
qos: .default,
attributes: .concurrent
)
let artworkSemaphore = DispatchSemaphore(value: 5)
extension Song {
func artworkImage(for size: CGSize, completion: @escaping (UIImage?) -> Void) {
artworkQueue.async {
artworkSemaphore.wait()
defer {
artworkSemaphore.signal()
}
let imageURL = artwork?.url(
width: Int(size.width),
height: Int(size.height)
)
// I hate doing this as it might very well break in the future
guard let imageURL, imageURL.scheme == "musicKit"
else {
return completion(nil)
}
guard let imageData = try? Data(contentsOf: imageURL),
let image = UIImage(data: imageData) else {
return completion(nil)
}
completion(image)
}
}
}
I really dislike this approach because it feels hacky but somewhat works. You might ask what's the semaphore for? Well, without it I could notice that MusicKit was choking and after reading too many artworks at once.
Can someone from Apple please provide us with an example on how to use MusicKit with UIKit properly?
Ideally (IMO) we would have a method defined on Song and other MusicKit structures that returns the image for us, just like MPMediaItem had the .artwork() method. It would make our lives so much easier.
Has anyone found a way to retrieve user token if I want to make an app on Flutter that uses that to make Apple Music API calls to just retrieve the user data and display it on the application?
Something like when a user opens their app, there is a button that says connect with apple. It takes the user to give permissions for apple music and that retrieves their user token.
I know there is Music Kit on Swift but i wonder if there is something like that on flutter
We are looking at potentially adding access to Apple Music Classical into a game we have with classical music. I cannot find any documentation that states if MusicKit can access the subscription content on Apple Music Classical. We would prefer to give our players the option to play with the higher quality subscription music if desired.
Thank you in advance for your assistance.
Hello,
Can we use below mentioned keys in our code :-
_MRMediaRemotePlayerPlaybackStateDidChangeNotification
kMRMediaRemotePlaybackStateUserInfoKey
Thanks
Hello everyone!
Im new to this forum and i have a question about playing mp3 files on
our Homepage on apple devices:
We have a service section with the latest News, Traffic and Weather on our Site.
The problem is, that the mp3 Files can be played, but the player shows 0:00 and is not able to go to the middle or end of the file.
This is ONLY on Iphone in our app and on Safari.
I am recording the mp3 with ffmpeg. The strange thing is, that there is no Bitrate shown in FIle details, and also no length.
The File is auto Recorded with a script.
I am trying to get the playbackStoreID via the MPMediaPickerController so I can play songs in my app. For many songs I can see and select I am getting a value of "0" for the playbackStoreID on the returned MPMediaItem.
Now if I use the "Music" app I can play those songs, but since the playbackStoreID is "0" I cannot successful get them in the queue for a MPMusicPlayerController.applicationQueuePlayer
What's the deal?
How do I get a proper ID that I can use to get those songs played?
If I cannot, how can I hide those songs from the MPMediaPickerController so a user does not think they can play those songs in my app?
Hi, is there a way to display the animated cover art in an app? Not every album has a cover art but for the ones that have one I would like to display them instead of the artwork.
Thank you :)
I have some depth map files in TIFF format that I am trying to extract data from programmatically. I see that I can import TIFF format images with NSImage, and from there, can get the raw pixel data. But how do I convert this to real distances? Any help would be appreciated, thanks!
I have a page that needs to display a large PNG image (1024 x 100247 )
Everything works fine in Chrome and Edge, but failed in safari.
this is test image :
https://storage-staging.passton.jp/images/2024/03/11/E0R6G8FKd3B3iLPO.png
is there any limit in safari ?