Media Player

RSS for tag

Find and play songs, audio podcasts, audio books, and more from within your app using Media Player.

Media Player Documentation

Posts under Media Player tag

85 Posts
Sort by:
Post not yet marked as solved
0 Replies
356 Views
Hi, In iOS 17.0 Apple introduced a favorite button for the music app. This favorite button is available everywhere including Control Center and CarPlay. My question is if there is a way to show/use this favorite button in my own app. Couldn't find it in the documentation. Thank you..!
Posted
by wotson.
Last updated
.
Post not yet marked as solved
0 Replies
399 Views
I am detecting problems with the volume level with the Bluetooth connection after the iOS 17.2 update. Before this problem persisted on the iPhone 11 and the iPhone 15 Pro, after the 17.2 update it seems that the problem was fixed on the iPhone 11 but still It persists on the iPhone 15 Pro. I have never had problems with the volume level in my car, but something Apple has changed that continues to affect it. How can it be corrected? Thank you very much for your support. I did a test with the same song and the same volume level (maximum volume on the smartphone and volume 12 on my Suzuki Swift) and these were the decibels results obtained. The Iphone 11 and 15 Pro has updated to iOS 17.2
Posted
by Ramasa79.
Last updated
.
Post not yet marked as solved
0 Replies
421 Views
I am reaching out to you as I am currently trying to solve an issue involving AVPlayer, and I have encountered a challenge related to handling errors for video segments. In our implementation, we have noticed that AVPlayer tends to make contiuous calls to fetch the video segments when video segments returns errors. AVPlayer tries for approximately 30 seconds before throwing an error. We observed this issue when video segments return 404 or 5xx errors. Please fnd below screenshot for the same. Is there any recommended approach or configuration setting that can be applied to restrict the number of calls AVPlayer makes in such scenarios. We are particularly interested in finding a solution that can help reduce the number of calls that are made in case of such failures. I look forward to hearing from you soon and appreciate your support in resolving this matter.
Posted Last updated
.
Post not yet marked as solved
0 Replies
436 Views
We are implementing new Live Activities in our app (we are a live shopping app). We also have PIP however i've noticed that when I start a live activity, then go into picture in picture, the dynamic island does not show the activity we've created for it. I can only see the activity on the lock screen widget while the audio for the videos plays. Is there any way to get the dynamic island to work with an app that is also in picture in picture? If there is and I'm doing something wrong, I can post some code. But from what I see, these don't seem to be compatible unfortunately :(
Posted
by nickdv125.
Last updated
.
Post not yet marked as solved
0 Replies
279 Views
Hi everyone, I'm the owner of a radio station called Radio Krimi and we have an official APP on iOS but because the technician, don't replied anymore to our message, we would like to update it with a new audio link. Then deeply sorry but I really don't know how to do it, basically it sould be easy because is a just a new link instead an old one. Please someone could help us with the process ? Thanks a lot ! Seb https://apps.apple.com/fr/app/radio-krimi/id1034088733
Posted
by Krimi74.
Last updated
.
Post not yet marked as solved
1 Replies
453 Views
Since the latest updates of macOS, probably 14.1, I have not been able to play media using SystemMusicPlayer.shared or MPMusicPlayerController.systemMusicPlayer. ApplicationMusicPlayer still works. This is the error code I am encountering: systemMusicPlayer _establishConnectionIfNeeded failed [application failed to launch] Failed to prepareToPlay with error: Error Domain=MPMusicPlayerControllerErrorDomain Code=10 "Failed to obtain remoteObject [nil server]" UserInfo={NSDebugDescription=Failed to obtain remoteObject [nil server]} Here is a small example to reproduce the bug. MPMusicPlayerController.systemMusicPlayer.setQueue(with: ["1445887715"]) MPMusicPlayerController.systemMusicPlayer.prepareToPlay() Or: extension PlayableMusicItem { // Not working func playWithSystemPlayer() { Task { SystemMusicPlayer.shared.queue = [self] try await SystemMusicPlayer.shared.play() } } // Working func playWithApplicationPlayer() { Task { ApplicationMusicPlayer.shared.queue = [self] try await ApplicationMusicPlayer.shared.play() } } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
375 Views
Hi there, I am trying to retrieve over 450+ urls of podcast episodes by using `api_url = f'https://itunes.apple.com/lookup?id={podcast_id}&entity=podcastEpisode&limit=200'. Even I modified the limit, I can only get 200 items. Anyone has an idea about this issue? Any resonse is appreciated!! Best!
Posted Last updated
.
Post not yet marked as solved
0 Replies
314 Views
How to recognize #EXT-OATCLS-SCTE35 tag in live HLS playlist and also manifest has other custom tags. I have tried using timedMetadata property of AVPlayerItem , KVO approach. But it's not notifying the presence of this tag. Can someone help me in implementing this?
Posted Last updated
.
Post not yet marked as solved
1 Replies
637 Views
Hi. In iOS 17 Apple introduced crossfading for the Music app. In my app I am using MPMusicPlayerController.applicationQueuePlayer and also want to support crossfading. In an early beta of iOS 17 my app crossfaded automatically with the same setting as for the Music app which maybe was a bug. However, I did not find any way to enable crossfade for my app. Does anybody know how to do that? Thanks, Dirk
Posted
by Tichel.
Last updated
.
Post not yet marked as solved
0 Replies
376 Views
I'm trying to show likeCommand and dislikeCommand on the Lock Screen of a music player without success. Are they still supported ? Is there any special configuration on the player or the track for them to show? My current code which works for playCommand looks like this MPRemoteCommandCenter.shared().likeCommand.addTarget { [unowned self] _ in if isPlaying { return .success } return .commandFailed }
Posted
by ahbou.
Last updated
.
Post not yet marked as solved
0 Replies
440 Views
Our initial understanding was that this event is fired only when the DRM blocks the video playback. However, in the present case we see that it is called even when playback is successful(playback with external screen connected). To assess whether playback remains functional when the 'outputObscuredDueToInsufficientExternalProtection' event is triggered, we conducted two specific scenario tests: 1) playing an asset without any DRM restrictions, and 2) playing an asset with DRM restrictions. Result: In our analysis, we have identified that the 'outputObscuredDueToInsufficientExternalProtection' flag always remains set to one, even when playback is successful. However, it is expected to be set to zero when the playback is successful. working case log when playback is successful: default 13:23:19.096682+0530 AMC ||| observeValueForKeyPath = "outputObscuredDueToInsufficientExternalProtection" object = <AVPlayer: 0x281284930> change kind = { kind = 1; new = 1; old = 0; } non working case log when playback came as black screen: default 13:45:21.356857+0530 AMC ||| observeValueForKeyPath = "outputObscuredDueToInsufficientExternalProtection" object = <AVPlayer: 0x281c071e0> change kind = {kind = 1; new = 1; old = 0; } We searched through related documents and conducted a Google search, but we couldn't find any information or references related to this behavior of the 'outputObscuredDueToInsufficientExternalProtection' event. It would be really appreciated if any one can help us with this!
Posted
by vinay1234.
Last updated
.
Post not yet marked as solved
0 Replies
386 Views
We have a logic in the SDK which stops playback when the outputObscuredDueToInsufficientExternalProtection event is fired by the player. Our initial understanding was that this event is fired only when the DRM blocks the video playback. However, in the present case we see that it is called even when playback is successful(playback with external screen connected). To determine whether playback still functions when the 'outputObscuredDueToInsufficientExternalProtection' event is triggered, we temporarily disabled the playback stop implementation that occurs after the event is triggered. code snippet - Observations - After this event was triggered during mirroring playback using a Lightning to HDMI connector, our expectation was that the playback would result in a black screen. However, to our surprise, the playback worked perfectly, indicating that this event is being triggered even when there are no DRM restrictions for that asset's playback. Another scenario we tested involved using a VGA connector. In this case, we observed that the 'outputObscuredDueToInsufficientExternalProtection' event was triggered. Initially, playback started as expected when we commented out the playback stop implementation. However, after a few seconds of playback, the screen went black. In the first scenario, it was unexpected for the 'outputObscuredDueToInsufficientExternalProtection' event to trigger, as the playback worked without issues even after the event was triggered. However, in the second scenario, the event was triggered as expected. The issue we identified is that this event is being triggered irrespective of the presence of DRM restrictions for the asset. In another scenario, we attempted to differentiate between the VGA and HDMI connectors to determine if such distinction was possible. However, we found that the VGA cable was also recognized as an HDMI port in the case of iOS. We also tested the issue on an older iOS version (iOS 14.6.1) to see if the problem persisted. Surprisingly, we found that the 'outputObscuredDueToInsufficientExternalProtection' event was triggered even in the older OS version. Conclusion: In our analysis, we have identified that the 'outputObscuredDueToInsufficientExternalProtection' flag always remains true even though output is not obsecured. working case log: default 13:23:19.096682+0530 AMC ||| observeValueForKeyPath = "outputObscuredDueToInsufficientExternalProtection" object = <AVPlayer: 0x281284930> change kind = { kind = 1; new = 1; old = 0; } non working case log: default 13:45:21.356857+0530 AMC ||| observeValueForKeyPath = "outputObscuredDueToInsufficientExternalProtection" object = <AVPlayer: 0x281c071e0> change kind = {kind = 1; new = 1; old = 0; } We searched through related documents and conducted a Google search, but we couldn't find any information or references related to this behavior of the 'outputObscuredDueToInsufficientExternalProtection' event. It would be really appreciated if any one can help us with this!
Posted
by vinay1234.
Last updated
.
Post not yet marked as solved
0 Replies
335 Views
Application is getting stuck when video is just start playing in AVPlayer and receive a phone call on iPhone. I have try to handle the the use case in applicationWillResignActive: delegate method but I am not receiving call back on this in case of phone call receive. Please help.
Posted Last updated
.
Post not yet marked as solved
2 Replies
656 Views
We have a web application which is having stalled html video element issue on iOS Safari. iOS Version 17.0.3. The html page contains a inline script tag for example <script> ... </script> and runs immediately when page loads. The script does following videoElement.src = url; videoElement.load(); The url is a HLS manifest url. After the DOM elements are created, we attatch the videoElement to a <div> and expecting the video reaches canplaythrough eventually and starts to playing. Actual Behavior: The video never plays videoElement readyState and networkState both stuck at value of 1 we found that "suspened" event was triggered on the video element and not sure who is triggering it. Temporary Mitigation: When video is stalled, if we call videoElement.load() manually in Safari js console, the readyState and networkState will increase and seeing HLS video segment are being fetched and video eventually reaches canplaythrough. This happens only on iOS Safari, not MacOS Safari. We suspect its because at begining when videoElement.src is set and .load() was called, the videoElement was not attached to any div so iOS decides to stop it to save battery. But its completely uneducated guess and any help would be appreciated. Thanks !
Posted
by tyrelltle.
Last updated
.
Post not yet marked as solved
0 Replies
647 Views
Hello, I'm developing a PWA, this app needs to use some features of the Audio API. one feature is MediaSource I get to work on all devices except iPhone. according to https://caniuse.com/?search=MediaSource it isn't supported on iPhone. are the plans to support this in the future? The application that I'm building creates a audioContext and audio elament. after that creates a buffer for type 'audio/mp4; codecs="mp4a.40.2'. and trys to fetch chunks of data into it. after the first chunk is loaded it starts playing. It works on my Mac and iPad I also tested on android. Hello, I'm developing a PWA (Progressive Web App). This app needs to use some features of the Audio API. One feature is MediaSource, which I've managed to get to work on all devices except the iPhone. According to Can I use Can I use, it isn't supported on iPhone. Are there plans to support this in the future? The application that I'm building creates an audioContext and audio element. After that, it creates a buffer for the type 'audio/mp4; codecs="mp4a.40.2".' and tries to fetch chunks of data into it. After the first chunk is loaded, it starts playing. It works on my Mac and iPad; I also tested it on Android.
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
We noticed iOS 16 doesn't seem to support these commands anymore: MPRemoteCommandCenter.shared().likeCommand MPRemoteCommandCenter.shared().dislikeCommand MPRemoteCommandCenter.shared().bookmarkCommand Or is there another way to show a menu in lieu of the previous button on the lock screen?
Posted
by chival.
Last updated
.
Post not yet marked as solved
0 Replies
530 Views
I have an AVPlayerViewController in my app to play custom audio+image or video streamed from an online service. If I set the below, I am able to add info to the nowPlayingInfo dictionary avplayerController.updatesNowPlayingInfoCenter = false This works for iOS control centre, it correctly displays my custom album name, artwork etc. But when using airplay for audio, it only displays the track name while playing audio. It doesn't display the artwork or the album etc. However if I set avplayerController.player?.allowsExternalPlayback = false It does correctly display artwork, title, album etc. This however disables the airplay button thats inbuilt on the player. I would like this button to remain, but need the artwork to be displayed while airplay-ing. How to I achieve this?
Posted
by simonmcl.
Last updated
.