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
370 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
Post not yet marked as solved
0 Replies
409 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
Post not yet marked as solved
0 Replies
435 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
by
Post not yet marked as solved
0 Replies
461 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
Post not yet marked as solved
0 Replies
291 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
Post not yet marked as solved
1 Replies
480 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
by
Post not yet marked as solved
0 Replies
395 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
by
Post not yet marked as solved
0 Replies
327 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
by
Post not yet marked as solved
0 Replies
393 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
Post not yet marked as solved
0 Replies
451 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
Post not yet marked as solved
0 Replies
399 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
Post not yet marked as solved
0 Replies
347 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
by
Post not yet marked as solved
0 Replies
681 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
by
Post not yet marked as solved
2 Replies
690 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
Post not yet marked as solved
0 Replies
551 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
Post not yet marked as solved
1 Replies
559 Views
Hello, I have a music player application that uses MPMusicPlayerController to play Apple Music songs. Now I want to add a Widget to it that can trigger playback pause on iOS 17. How do I need to achieve this? I can get the playbackStoreID of the song on the Widget Extension and use MPMusicPlayerController setQueue(with:) to play it. How do I pass the playbackStoreID in the Widget to the main application for playback, or should I create a new MPMusicPlayerController on the Widget Extension for playback?
Posted
by
Post not yet marked as solved
1 Replies
337 Views
We have received a lot of user feedback, saying that our app caused the video in the user's system album to not play, we did reproduce this phenomenon after operating some modules of our app many times, after monitoring the device log, click on the system album z probably received the following abnormal error VideoContentProvider received result:<AVPlayerItem: 0x281004850, asset = <AVURLAsset: 0x28128fce0, URL = file:///var/mobile/Media/DCIM/100APPLE/IMG_0085.MP4>>, info:{ PHImageResultRequestIDKey = 316; }, priority:oneup automatic, strategy:<PXDisplayAssetVideoContentDeliveryStrategy: 0x2836c3000>quality: medium+(med-high), segment:{ nan - nans }, streaming:YES, network:YES, audio:YES, targetSize:{1280, 1280}, displayAsset:8E30C461-B089-4142-82D9-3A8CFF3B5DE9 <PUBrowsingVideoPlayer: 0xc46a59770> Asset : <PHAsset: 0xc48f5fc50> 8E30C461-B089-4142-82D9-3A8CFF3B5DE9/L0/001 mediaType=2/524288, sourceType=1, (828x1792), creationDate=2023-07-19 上午7:36:41 +0000, location=0, hidden=0, favorite=0, adjusted=0 VideoSession : <PXVideoSession 0xc48a1ec50> { Content Provider: <PXPhotoKitVideoContentProvider: 0x282d441e0>, Asset <PHAsset: 0xc48f5fc50> 8E30C461-B089-4142-82D9-3A8CFF3B5DE9/L0/001 mediaType=2/524288, sourceType=1, (828x1792), creationDate=2023-07-19 上午7:36:41 +0000, location=0, hidden=0, favorite=0, adjusted=0 , Media Provider: <PUPhotoKitMediaProvider: 0x28104da70> Desired Play State: Paused Play State: Paused Stalled: 0 At Beginning: 1 End: 0 Playback: ‖ Paus √ b0 a0 s0 l1 f0 e0 r0.0 0.000/60.128 VideoOutput: (null) Got First Pixel Buffer: NO Pixel Buffer Frame Drops: 0 Buffering: 0 }: Starting disabling of video loading for reason: OutOfFocus <PUBrowsingVideoPlayer: 0xc46de66e0> Asset : <PHAsset: 0xc48f5f1d0> 11ECA95E-0B79-4C7C-97C6-5958EE139BAB/L0/001 mediaType=2/0, sourceType=1, (1080x1920), creationDate=2023-09-21 上午7:54:46 +0000, location=1, hidden=0, favorite=0, adjusted=0 VideoSession : (null): Starting disabling of video loading for reason: OutOfFocus I think this message is imporant VideoSession : (null): Starting disabling of video loading for reason: OutOfFocus restart the iPhone can resolve this anomalous ,can you know reason or how to avoid this bug the bug like :https://discussionschinese.apple.com/thread/254766045 https://discussionschinese.apple.com/thread/254787836
Posted
by