Media Player

RSS for tag

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

Posts under Media Player tag

200 Posts

Post

Replies

Boosts

Views

Activity

CarPlay: CPListItem isPlaying indicator not updating
I've created a CPListTemplate with dynamic list entries from an API. All entries are different music channels. In my ForEach for generating all list entries, I've set the .isPlaying property to true and also the playingIndicatorLocation to .trailing. If I play a channel, the isPlaying indicator is animated on every list entries. I've set different metadata in the MPNowPlayingInfoCenter and this is correct inside the CPNowPlayingTemplate. Do I need to set some identifier somewhere, so my list template knows which channel is currently playing? If so where can I set this?
1
0
1.1k
Apr ’23
Matching the Queue.CurrentEntry.Item.ID with a Song's ID. Can't tell if it's a bug
I'm trying to match the id of the song currently playing with the id of the song I added to the queue, but they never match. musicPlayer.queue = [mySongVar] print(mySongVar) This will print out: Song(id: "i.eoqMkIkPJ9Ea", title: "À peu près", artistName: "Pomme") then I tell the musicPlayer to play what's in the queue and print: print(musicPlayer.queue.currentEntry!.item!.description) And I´ll get this: MusicPlayer.Queue.Entry.Item.song(Song(id: "1440887303", title: "À peu près", artistName: "Pomme")) I don't understand why the Song.id for the Item for the queue's current entry is a a certain string, but the if for my original Song object I sent to the queue is something else entirely. I'm not sure if I'm going about this the wrong way. I'd really appreciate some help/guidance! Thanks" By the way: let musicPlayer = ApplicationMusicPlayer.shared
1
0
1.1k
Apr ’23
-[MPVolumeView initWithFrame:style:] block main thread
MediaPlayer -[MPVolumeView initWithFrame:style:] + 80 MediaPlayer -[MPVolumeView _initWithStyle:] + 124 MediaPlayer -[MPAVLightweightRoutingController initWithName:] + 140 AVFCore -[AVOutputDeviceDiscoverySession initWithDeviceFeatures:] + 84 I get an application Not Responding problem by capturing function call stack every runloop(1/60s frequency) and get same call stack at about 5 second. MediaPlayer -[MPVolumeView initWithFrame:style:] + 80 MediaPlayer -[MPVolumeView _initWithStyle:] + 124 MediaPlayer -[MPAVLightweightRoutingController initWithName:] + 140 AVFCore -[AVOutputDeviceDiscoverySession initWithDeviceFeatures:] + 84 AVFCore -[AVFigRouteDiscovererOutputDeviceDiscoverySessionFactory outputDeviceDiscoverySessionOfClass:withDeviceFeatures:] + 216 AVFCore -[AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl initWithFigRouteDiscovererCreator:syncController:] + 156 AVFCore _AVFigRouteDiscovererFactoryCreateRouteDiscovererWithType + 132 AVFCore -[AVFigRemoteRouteDiscovererFactory createRouteDiscovererWithAllocator:options:] + 40 MediaExperience _FigRouteDiscovererXPCRemoteCreate + 912 CoreMedia _FigXPCRemoteClientSendSyncMessageCreatingReply + 40 libxpc.dylib _xpc_connection_send_message_with_reply_sync + 228 libdispatch.dylib _dispatch_mach_send_with_result_and_wait_for_reply + 60 libdispatch.dylib __dispatch_mach_send_and_wait_for_reply + 532 libsystem_kernel.dylib _mach_msg + 72 libsystem_kernel.dylib _mach_msg_trap + 8``` It seems that sync waiting for a xpc reply, I want to solve this by call `-[MPAVLightweightRoutingController initWithName:]` on a background thread, but it's call from `-[MPVolumeView initWithFrame:style:]`, I can not create UIView object from background thread. I have no idea about how to solve this.
2
0
1.1k
Apr ’23
Crash in MediaToolbox __setVideoBounds_block_invoke
We are getting MediaToolbox crash in tvOS and iOS 14* versions. Stack track is not providing any details about origin of the issue. Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x54a8 objc_msgSend + 8 1 MediaToolbox 0x2ba198 __setVideoBounds_block_invoke + 84 2 libdispatch.dylib 0x579c _dispatch_call_block_and_release + 24 3 libdispatch.dylib 0x6fdc _dispatch_client_callout + 16 4 libdispatch.dylib 0x13de4 _dispatch_main_queue_callback_4CF + 872 5 CoreFoundation 0x9d030 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 6 CoreFoundation 0x974e8 __CFRunLoopRun + 2480 7 CoreFoundation 0x96600 CFRunLoopRunSpecific + 572 8 GraphicsServices 0x6598 GSEventRunModal + 160 9 UIKitCore 0x9e3b98 -[UIApplication _run] + 1060 10 UIKitCore 0x9e9148 UIApplicationMain + 164 11 libswiftUIKit.dylib 0xf7a4 UIApplicationMain(_:_:_:_:) + 100 12 hotstarx-tvos 0x7350 main + 4313412432 (RequestButton.swift:4313412432) 13 libdyld.dylib 0x25fc start + 4 2022-11-16_08-26-25.9239_+0200-d28480707c71a8eed186b5d64400dbe3fe2425bf.crash
0
0
659
Apr ’23
Crash in MediaToolbox __setVideoBounds_block_invoke
We are getting MediaToolbox crash in tvOS 14* versions. Stack track is not providing any details about origin of the issue. Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x54a8 objc_msgSend + 8 1 MediaToolbox 0x2ba198 __setVideoBounds_block_invoke + 84 2 libdispatch.dylib 0x579c _dispatch_call_block_and_release + 24 3 libdispatch.dylib 0x6fdc _dispatch_client_callout + 16 4 libdispatch.dylib 0x13de4 _dispatch_main_queue_callback_4CF + 872 5 CoreFoundation 0x9d030 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 6 CoreFoundation 0x974e8 __CFRunLoopRun + 2480 7 CoreFoundation 0x96600 CFRunLoopRunSpecific + 572 8 GraphicsServices 0x6598 GSEventRunModal + 160 9 UIKitCore 0x9e3b98 -[UIApplication _run] + 1060 10 UIKitCore 0x9e9148 UIApplicationMain + 164 11 libswiftUIKit.dylib 0xf7a4 UIApplicationMain(_:_:_:_:) + 100 12 hotstarx-tvos 0x7350 main + 4313412432 (RequestButton.swift:4313412432) 13 libdyld.dylib 0x25fc start + 4 2022-11-16_08-26-25.9239_+0200-d28480707c71a8eed186b5d64400dbe3fe2425bf.crash
1
0
927
Apr ’23
Signing error when implementing playbackState reporting
Hi, I'm trying set playbackState like swift MPNowPlayingInfoCenter.default().playbackState = .playing But I receive an error in console. [NowPlaying] [MRNowPlaying] Ignoring setPlaybackState because application does not contain entitlement com.apple.mediaremote.set-playback-state for platform I tried to add it to applications *.entitlements file: xml     keycom.apple.mediaremote.set-playback-state/key     true/ But after that I cannot even build my application due to signing error: Provisioning profile "iOS Team Provisioning Profile: app.name" doesn't include the com.apple.mediaremote.set-playback-state entitlement. I use a free development certificate if it is important. Xcode version is 12.4. Did anyone face with same issue? What do I wrong? What should I do to solve an issue? Thanks for any help!
6
1
6.1k
Mar ’23
Chromecast videos from own website on a view controller
Hi all, I have enabled the ChromeCast icon via Google Cast SDK framework in my app. I am able to cast to my TV, that works fine. But, I cannot cast any media. It says "No media selected" although I am opening a video file and play it. I have an app that is connected to my website so I use UIWebKit and WebView to display my content. On my site I have lots of videos that I would like to be able to cast via ChromeCast, just like Netflix and other streaming video apps. Does anyone know if this is possible and if so, what is needed in the code to make that possible? Thank you very much in advance!
0
0
567
Mar ’23
"[SDKPlayback] applicationController: xpc service connection interrupted" for MPMusicPlayerController.applicationMusicPlayer iOS 16.3.1
Hi! I'm having a problem that I cannot seem to figure out. I have not made any changes to my app, yet this suddenly started happening. I think it started happening after I upgraded my phone to iOS 16.3.1, but I am not entirely sure. Pseudocode: // (1) initialise player let player = MPMusicPlayerController.applicationMusicPlayer // (2) ..later, a button is pressed and we call play() player.play(myAlbumId) // (3) a background timer runs, which will ensure we are playing for 30 seconds, and pausing for 60 seconds (this is a workout app): self.timer = Timer(timeInterval: 1.0, target: self, selector: #selector(togglePauseIfNeeded), userInfo: nil, repeats: true) RunLoop.current.add(self.timer!, forMode: .common) // (4) Now, the problem occurs when the timer triggers play, the second time we are playing music (ie, it works the initial time, but in that case, play was triggered by a button press (step 2)). // So when the timer now calls player.play(), we see this error: "[SDKPlayback] applicationController: xpc service connection interrupted" player.play() Interestingly, if I manually hit play just a few seconds before the timer would have called "play" (at step 4), it works fine. Any thoughts or help on this would be highly appreciated! <3
0
0
785
Mar ’23
Podcast -Error (This server does not support HTTP head requests)
Hello i was setup an Podcast rss under the following url: https://www.eybwallwitz.de/feeds/podcasts/ But i dont get it up running. When i validate the Feed with https://podba.se/ it says: everything is ok: https://podba.se/validate/?url=https://www.eybwallwitz.de/feeds/podcasts But when i use https://www.castfeedvalidator.com/validate.php?url=https://www.eybwallwitz.de/feeds/podcasts i get the Message: FATAL: This server does not support HTTP head requests. Head request support required for Apple Podcasts. Did not finish media tests. I really dont get the problem. I use a nginx 1.18 webserver. Cause i didnt found the problem i explicit allowed HEAD, GET, POST, Options on Feed URL I adjustet mp3 urls with content-disposition: inline; filename="$filename" But nothing works. I tryed to load the feed into my podcast app but the feed from url didnt work, so validator 2 looks like to be right, that there is a problem. i used curl --head to verify check and compare between an old feed an the new one old: https://2020.eybwallwitz.de/de/publikationen/podcast/feed/ new: https://www.eybwallwitz.de/feeds/podcasts/ i expect the problem somewhere in nginx. so if u need more infos, please give me a sign. also when u have any idea what i can do/test to get this problem away. currently i dont have any idea left. thx peter
0
0
659
Feb ’23
The class AudioFileResource of RealityKit can not play audio
I am using RealitKit SDK to insert audio into the AR program. According to the description on the official website, I need to use the class AudioFileResource to load audio, and then the Entity object calls the prepareAudio() method to get an AudioPlaybackController, which is used to play audio, but there is no sound. Has anyone ever encountered this situation?
0
0
618
Feb ’23
IOS 16.1.1 Automatic resume playback
When playing music or a podcast in the Spotify application (as well as using car play), an audio notification may occur from the Waze application, after the notification, playback in the Spotify application usually continues automatically. Well, the new update does not work properly to automatically resume listening, you need to press play again in the Spotify app. Please fix it, it's very annoying.
1
2
2.1k
Feb ’23
Preload AVAsset
I have to make sure that I have fully loaded the videos before playing them. I went through the Apple documentation but couldn't find how to do it. I tried AVAssetDownloadTask but I don't want to keep the files. I want them to be deleted after the app is closed. Is there a recommended method for this? I need to make sure the videos are fully downloaded and ready to play. So AVPlayer's default behavior doesn't work for me
0
1
874
Feb ’23
Apple CarPlay Issue
Hello everyone, Apple CarPlay is implemented in one of my applications by using MediaPlayer Framework. It is working properly if iPhone is locked, the App is in the background, or in an Active state. But I want to play audio from CarPlay even if the App is in a terminated state similar to Spotify app does. In case of application is not opened in the phone, on CarPlay display selecting the station does not play the song. You can see in the below videos for both cases: [https://algoworks-my.sharepoint.com/:v:/p/ankit_singh/EQ3HzSKEl-pGpMIK0vh7HIkBtWg50-vco3aTyxOZevmuTA?e=2pmmWB) [https://algoworks-my.sharepoint.com/:v:/p/ankit_singh/EeI8qai1iftKvwo9nogCJREBFQXCf3qf8d-qwIt-25CB7g?e=bkYqAH) I tried many things but not able to achieve this. So help me with this and share some code to review. Thanks.
0
0
1.1k
Feb ’23
Making a task while phone is locked works on simulator, but not on physical device
I am working on an app that makes a custom alarm so I am using long music from outsourced platforms like Spotify, everything is done but the current issue is when I try to play the music when the phone is locked it doesn't work on a physical device but works on the simulator!, what I am doing is schedule a local notification to turn on the screen at this time then play the music from a scheduled timer. Here is the snippet of the code responsible for this. let timer = Timer(timeInterval: time.timeIntervalSinceNow, repeats: false) { timer in // Doing the task here! playAlarm() } RunLoop.current.add(timer, forMode: .common) Note: To run this task when the phone is locked I am sending a local notification at this time to turn on the screen to make it possible to run this task. Please let me know if this is possible as I see some apps doing this
0
0
772
Jan ’23
Unable to update the MPMediaItem (Lock Screen Media Controls)
I'm currently developing an app that can reproduce audio and video from the web (my own server) using SwiftUI targeting iOS15 and testing on a iPhone XS Pro Max running iOS16.2 (real device) Both the video and audio play just fine but I get this (image in the end of the post) in as the media controls. The current time and duration are correct and updated (without me calling to update them) but I'm unable to actually update the title, artist, album and artwork My first thought was to update the NowPlaying and after a lengthy search I'm yet to find a solution that works I created a small class to update the NowPlaying info import Foundation import UIKit import MediaPlayer public class MediaController {     var nowPlayingInfo = [String: Any]()     static let shared = MediaController()     private init() { }     func setupNotificationView(title: String?, album: String?, artist: String?, thumbnailUrl: String) {         nowPlayingInfo = [String : Any]()         nowPlayingInfo[MPMediaItemPropertyTitle] = title         nowPlayingInfo[MPMediaItemPropertyAlbumTitle] = album         nowPlayingInfo[MPMediaItemPropertyArtist] = artist MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo     } } The NowPlaying still doesn't update This is the call sequence when I press play let avAsset = AVURLAsset(url: URL(string: "https://domain.com/video.mp4") let avItem = AVPlayerItem(asset: avAsset) player.replaceCurrentItem(with: avItem) do { try AVAudioSession.sharedInstance().setActive(true); } catch { print(error) } player.play() MediaController.shared.setupNotificationView(title: "A Title", album: "A Album", artist: "A Artist", thumbnailUrl: "") Although the app is being developed using SwiftUI I'm using the UIViewControllerRepresentable to display a the video using AVPlayerViewController since the current one misses the PiP and under makeUIViewController I have the following code let controller = AVPlayerViewController() controller.player = player controller.allowsPictureInPicturePlayback = true controller.entersFullScreenWhenPlaybackBegins = true controller.delegate = context.coordinator and on the app launch I have the following let audioSession = AVAudioSession.sharedInstance() do { try audioSession.setCategory(AVAudioSession.Category.playback) } catch { print("Setting category to AVAudioSessionCategoryPlayback failed.") } And yes I have the background mode capability enabled for "Audio, AirPlay and Picture in Picture" I'm at a lost here and hope someone can help.
2
0
1.9k
Dec ’22
CarPlay: CPListItem isPlaying indicator not updating
I've created a CPListTemplate with dynamic list entries from an API. All entries are different music channels. In my ForEach for generating all list entries, I've set the .isPlaying property to true and also the playingIndicatorLocation to .trailing. If I play a channel, the isPlaying indicator is animated on every list entries. I've set different metadata in the MPNowPlayingInfoCenter and this is correct inside the CPNowPlayingTemplate. Do I need to set some identifier somewhere, so my list template knows which channel is currently playing? If so where can I set this?
Replies
1
Boosts
0
Views
1.1k
Activity
Apr ’23
Matching the Queue.CurrentEntry.Item.ID with a Song's ID. Can't tell if it's a bug
I'm trying to match the id of the song currently playing with the id of the song I added to the queue, but they never match. musicPlayer.queue = [mySongVar] print(mySongVar) This will print out: Song(id: "i.eoqMkIkPJ9Ea", title: "À peu près", artistName: "Pomme") then I tell the musicPlayer to play what's in the queue and print: print(musicPlayer.queue.currentEntry!.item!.description) And I´ll get this: MusicPlayer.Queue.Entry.Item.song(Song(id: "1440887303", title: "À peu près", artistName: "Pomme")) I don't understand why the Song.id for the Item for the queue's current entry is a a certain string, but the if for my original Song object I sent to the queue is something else entirely. I'm not sure if I'm going about this the wrong way. I'd really appreciate some help/guidance! Thanks" By the way: let musicPlayer = ApplicationMusicPlayer.shared
Replies
1
Boosts
0
Views
1.1k
Activity
Apr ’23
-[MPVolumeView initWithFrame:style:] block main thread
MediaPlayer -[MPVolumeView initWithFrame:style:] + 80 MediaPlayer -[MPVolumeView _initWithStyle:] + 124 MediaPlayer -[MPAVLightweightRoutingController initWithName:] + 140 AVFCore -[AVOutputDeviceDiscoverySession initWithDeviceFeatures:] + 84 I get an application Not Responding problem by capturing function call stack every runloop(1/60s frequency) and get same call stack at about 5 second. MediaPlayer -[MPVolumeView initWithFrame:style:] + 80 MediaPlayer -[MPVolumeView _initWithStyle:] + 124 MediaPlayer -[MPAVLightweightRoutingController initWithName:] + 140 AVFCore -[AVOutputDeviceDiscoverySession initWithDeviceFeatures:] + 84 AVFCore -[AVFigRouteDiscovererOutputDeviceDiscoverySessionFactory outputDeviceDiscoverySessionOfClass:withDeviceFeatures:] + 216 AVFCore -[AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl initWithFigRouteDiscovererCreator:syncController:] + 156 AVFCore _AVFigRouteDiscovererFactoryCreateRouteDiscovererWithType + 132 AVFCore -[AVFigRemoteRouteDiscovererFactory createRouteDiscovererWithAllocator:options:] + 40 MediaExperience _FigRouteDiscovererXPCRemoteCreate + 912 CoreMedia _FigXPCRemoteClientSendSyncMessageCreatingReply + 40 libxpc.dylib _xpc_connection_send_message_with_reply_sync + 228 libdispatch.dylib _dispatch_mach_send_with_result_and_wait_for_reply + 60 libdispatch.dylib __dispatch_mach_send_and_wait_for_reply + 532 libsystem_kernel.dylib _mach_msg + 72 libsystem_kernel.dylib _mach_msg_trap + 8``` It seems that sync waiting for a xpc reply, I want to solve this by call `-[MPAVLightweightRoutingController initWithName:]` on a background thread, but it's call from `-[MPVolumeView initWithFrame:style:]`, I can not create UIView object from background thread. I have no idea about how to solve this.
Replies
2
Boosts
0
Views
1.1k
Activity
Apr ’23
Crash in MediaToolbox __setVideoBounds_block_invoke
We are getting MediaToolbox crash in tvOS and iOS 14* versions. Stack track is not providing any details about origin of the issue. Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x54a8 objc_msgSend + 8 1 MediaToolbox 0x2ba198 __setVideoBounds_block_invoke + 84 2 libdispatch.dylib 0x579c _dispatch_call_block_and_release + 24 3 libdispatch.dylib 0x6fdc _dispatch_client_callout + 16 4 libdispatch.dylib 0x13de4 _dispatch_main_queue_callback_4CF + 872 5 CoreFoundation 0x9d030 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 6 CoreFoundation 0x974e8 __CFRunLoopRun + 2480 7 CoreFoundation 0x96600 CFRunLoopRunSpecific + 572 8 GraphicsServices 0x6598 GSEventRunModal + 160 9 UIKitCore 0x9e3b98 -[UIApplication _run] + 1060 10 UIKitCore 0x9e9148 UIApplicationMain + 164 11 libswiftUIKit.dylib 0xf7a4 UIApplicationMain(_:_:_:_:) + 100 12 hotstarx-tvos 0x7350 main + 4313412432 (RequestButton.swift:4313412432) 13 libdyld.dylib 0x25fc start + 4 2022-11-16_08-26-25.9239_+0200-d28480707c71a8eed186b5d64400dbe3fe2425bf.crash
Replies
0
Boosts
0
Views
659
Activity
Apr ’23
Crash in MediaToolbox __setVideoBounds_block_invoke
We are getting MediaToolbox crash in tvOS 14* versions. Stack track is not providing any details about origin of the issue. Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x54a8 objc_msgSend + 8 1 MediaToolbox 0x2ba198 __setVideoBounds_block_invoke + 84 2 libdispatch.dylib 0x579c _dispatch_call_block_and_release + 24 3 libdispatch.dylib 0x6fdc _dispatch_client_callout + 16 4 libdispatch.dylib 0x13de4 _dispatch_main_queue_callback_4CF + 872 5 CoreFoundation 0x9d030 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 6 CoreFoundation 0x974e8 __CFRunLoopRun + 2480 7 CoreFoundation 0x96600 CFRunLoopRunSpecific + 572 8 GraphicsServices 0x6598 GSEventRunModal + 160 9 UIKitCore 0x9e3b98 -[UIApplication _run] + 1060 10 UIKitCore 0x9e9148 UIApplicationMain + 164 11 libswiftUIKit.dylib 0xf7a4 UIApplicationMain(_:_:_:_:) + 100 12 hotstarx-tvos 0x7350 main + 4313412432 (RequestButton.swift:4313412432) 13 libdyld.dylib 0x25fc start + 4 2022-11-16_08-26-25.9239_+0200-d28480707c71a8eed186b5d64400dbe3fe2425bf.crash
Replies
1
Boosts
0
Views
927
Activity
Apr ’23
Apple Music change volume
I'm integrating Apple Music on my ios app, and I want to change the volume programmatically. I'm using: let player = MPMusicPlayerController.applicationQueuePlayer player. But I found that this player doesn't have an API for changing volume. Any solutions, please?
Replies
0
Boosts
0
Views
724
Activity
Mar ’23
AVSampleBufferDisplayLayer: videoGravity do not work
Version: 14.x Setting videoGravity of AVSampleBufferDisplayLayer does not work, however, when I change bounds of this layer, it worked, is this a bug or feature? but in iOS 15, this propery worked well.
Replies
1
Boosts
0
Views
1.2k
Activity
Mar ’23
How do I access a FairPlay protected stream's frame in avplayer?
when i played a fairplay streaming by avplayer,calling copyPixelBufferForItemTime on AVPlayerItemVideoOutput the pixelbuffer returns NULL.is there any way to get the pixel buffer from a stream that is protected using FairPlay on iOS or apple's APIs in order to display FairPlay stream on an OpenGL texture in 3D space?
Replies
1
Boosts
0
Views
712
Activity
Mar ’23
Signing error when implementing playbackState reporting
Hi, I'm trying set playbackState like swift MPNowPlayingInfoCenter.default().playbackState = .playing But I receive an error in console. [NowPlaying] [MRNowPlaying] Ignoring setPlaybackState because application does not contain entitlement com.apple.mediaremote.set-playback-state for platform I tried to add it to applications *.entitlements file: xml     keycom.apple.mediaremote.set-playback-state/key     true/ But after that I cannot even build my application due to signing error: Provisioning profile "iOS Team Provisioning Profile: app.name" doesn't include the com.apple.mediaremote.set-playback-state entitlement. I use a free development certificate if it is important. Xcode version is 12.4. Did anyone face with same issue? What do I wrong? What should I do to solve an issue? Thanks for any help!
Replies
6
Boosts
1
Views
6.1k
Activity
Mar ’23
Chromecast videos from own website on a view controller
Hi all, I have enabled the ChromeCast icon via Google Cast SDK framework in my app. I am able to cast to my TV, that works fine. But, I cannot cast any media. It says "No media selected" although I am opening a video file and play it. I have an app that is connected to my website so I use UIWebKit and WebView to display my content. On my site I have lots of videos that I would like to be able to cast via ChromeCast, just like Netflix and other streaming video apps. Does anyone know if this is possible and if so, what is needed in the code to make that possible? Thank you very much in advance!
Replies
0
Boosts
0
Views
567
Activity
Mar ’23
"[SDKPlayback] applicationController: xpc service connection interrupted" for MPMusicPlayerController.applicationMusicPlayer iOS 16.3.1
Hi! I'm having a problem that I cannot seem to figure out. I have not made any changes to my app, yet this suddenly started happening. I think it started happening after I upgraded my phone to iOS 16.3.1, but I am not entirely sure. Pseudocode: // (1) initialise player let player = MPMusicPlayerController.applicationMusicPlayer // (2) ..later, a button is pressed and we call play() player.play(myAlbumId) // (3) a background timer runs, which will ensure we are playing for 30 seconds, and pausing for 60 seconds (this is a workout app): self.timer = Timer(timeInterval: 1.0, target: self, selector: #selector(togglePauseIfNeeded), userInfo: nil, repeats: true) RunLoop.current.add(self.timer!, forMode: .common) // (4) Now, the problem occurs when the timer triggers play, the second time we are playing music (ie, it works the initial time, but in that case, play was triggered by a button press (step 2)). // So when the timer now calls player.play(), we see this error: "[SDKPlayback] applicationController: xpc service connection interrupted" player.play() Interestingly, if I manually hit play just a few seconds before the timer would have called "play" (at step 4), it works fine. Any thoughts or help on this would be highly appreciated! <3
Replies
0
Boosts
0
Views
785
Activity
Mar ’23
Podcast -Error (This server does not support HTTP head requests)
Hello i was setup an Podcast rss under the following url: https://www.eybwallwitz.de/feeds/podcasts/ But i dont get it up running. When i validate the Feed with https://podba.se/ it says: everything is ok: https://podba.se/validate/?url=https://www.eybwallwitz.de/feeds/podcasts But when i use https://www.castfeedvalidator.com/validate.php?url=https://www.eybwallwitz.de/feeds/podcasts i get the Message: FATAL: This server does not support HTTP head requests. Head request support required for Apple Podcasts. Did not finish media tests. I really dont get the problem. I use a nginx 1.18 webserver. Cause i didnt found the problem i explicit allowed HEAD, GET, POST, Options on Feed URL I adjustet mp3 urls with content-disposition: inline; filename="$filename" But nothing works. I tryed to load the feed into my podcast app but the feed from url didnt work, so validator 2 looks like to be right, that there is a problem. i used curl --head to verify check and compare between an old feed an the new one old: https://2020.eybwallwitz.de/de/publikationen/podcast/feed/ new: https://www.eybwallwitz.de/feeds/podcasts/ i expect the problem somewhere in nginx. so if u need more infos, please give me a sign. also when u have any idea what i can do/test to get this problem away. currently i dont have any idea left. thx peter
Replies
0
Boosts
0
Views
659
Activity
Feb ’23
The class AudioFileResource of RealityKit can not play audio
I am using RealitKit SDK to insert audio into the AR program. According to the description on the official website, I need to use the class AudioFileResource to load audio, and then the Entity object calls the prepareAudio() method to get an AudioPlaybackController, which is used to play audio, but there is no sound. Has anyone ever encountered this situation?
Replies
0
Boosts
0
Views
618
Activity
Feb ’23
IOS 16.1.1 Automatic resume playback
When playing music or a podcast in the Spotify application (as well as using car play), an audio notification may occur from the Waze application, after the notification, playback in the Spotify application usually continues automatically. Well, the new update does not work properly to automatically resume listening, you need to press play again in the Spotify app. Please fix it, it's very annoying.
Replies
1
Boosts
2
Views
2.1k
Activity
Feb ’23
indexOfNowPlayingItem Bug in iOS 16.4 Beta 1
In iOS 16.4 Beta 1, the indexOfNowPlayingItem returns unexpected/incorrect value. In prior versions of iOS, the value returned was expected. I also plan on submitting a detailed bug report on Feedback Assistant once I have more details.
Replies
1
Boosts
0
Views
772
Activity
Feb ’23
Preload AVAsset
I have to make sure that I have fully loaded the videos before playing them. I went through the Apple documentation but couldn't find how to do it. I tried AVAssetDownloadTask but I don't want to keep the files. I want them to be deleted after the app is closed. Is there a recommended method for this? I need to make sure the videos are fully downloaded and ready to play. So AVPlayer's default behavior doesn't work for me
Replies
0
Boosts
1
Views
874
Activity
Feb ’23
Apple CarPlay Issue
Hello everyone, Apple CarPlay is implemented in one of my applications by using MediaPlayer Framework. It is working properly if iPhone is locked, the App is in the background, or in an Active state. But I want to play audio from CarPlay even if the App is in a terminated state similar to Spotify app does. In case of application is not opened in the phone, on CarPlay display selecting the station does not play the song. You can see in the below videos for both cases: [https://algoworks-my.sharepoint.com/:v:/p/ankit_singh/EQ3HzSKEl-pGpMIK0vh7HIkBtWg50-vco3aTyxOZevmuTA?e=2pmmWB) [https://algoworks-my.sharepoint.com/:v:/p/ankit_singh/EeI8qai1iftKvwo9nogCJREBFQXCf3qf8d-qwIt-25CB7g?e=bkYqAH) I tried many things but not able to achieve this. So help me with this and share some code to review. Thanks.
Replies
0
Boosts
0
Views
1.1k
Activity
Feb ’23
Making a task while phone is locked works on simulator, but not on physical device
I am working on an app that makes a custom alarm so I am using long music from outsourced platforms like Spotify, everything is done but the current issue is when I try to play the music when the phone is locked it doesn't work on a physical device but works on the simulator!, what I am doing is schedule a local notification to turn on the screen at this time then play the music from a scheduled timer. Here is the snippet of the code responsible for this. let timer = Timer(timeInterval: time.timeIntervalSinceNow, repeats: false) { timer in // Doing the task here! playAlarm() } RunLoop.current.add(timer, forMode: .common) Note: To run this task when the phone is locked I am sending a local notification at this time to turn on the screen to make it possible to run this task. Please let me know if this is possible as I see some apps doing this
Replies
0
Boosts
0
Views
772
Activity
Jan ’23
Notification of Media playback status Mac
Hello, I am working on a Mac app and I would like to be able to get notifications (NotificationCenter.default.addObserver.add... MPMusicPlayerControllerPlaybackStateDidChange) when media starts to play in other apps. Is this possible on Mac? Thanks in advance!
Replies
1
Boosts
0
Views
1.1k
Activity
Jan ’23
Unable to update the MPMediaItem (Lock Screen Media Controls)
I'm currently developing an app that can reproduce audio and video from the web (my own server) using SwiftUI targeting iOS15 and testing on a iPhone XS Pro Max running iOS16.2 (real device) Both the video and audio play just fine but I get this (image in the end of the post) in as the media controls. The current time and duration are correct and updated (without me calling to update them) but I'm unable to actually update the title, artist, album and artwork My first thought was to update the NowPlaying and after a lengthy search I'm yet to find a solution that works I created a small class to update the NowPlaying info import Foundation import UIKit import MediaPlayer public class MediaController {     var nowPlayingInfo = [String: Any]()     static let shared = MediaController()     private init() { }     func setupNotificationView(title: String?, album: String?, artist: String?, thumbnailUrl: String) {         nowPlayingInfo = [String : Any]()         nowPlayingInfo[MPMediaItemPropertyTitle] = title         nowPlayingInfo[MPMediaItemPropertyAlbumTitle] = album         nowPlayingInfo[MPMediaItemPropertyArtist] = artist MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo     } } The NowPlaying still doesn't update This is the call sequence when I press play let avAsset = AVURLAsset(url: URL(string: "https://domain.com/video.mp4") let avItem = AVPlayerItem(asset: avAsset) player.replaceCurrentItem(with: avItem) do { try AVAudioSession.sharedInstance().setActive(true); } catch { print(error) } player.play() MediaController.shared.setupNotificationView(title: "A Title", album: "A Album", artist: "A Artist", thumbnailUrl: "") Although the app is being developed using SwiftUI I'm using the UIViewControllerRepresentable to display a the video using AVPlayerViewController since the current one misses the PiP and under makeUIViewController I have the following code let controller = AVPlayerViewController() controller.player = player controller.allowsPictureInPicturePlayback = true controller.entersFullScreenWhenPlaybackBegins = true controller.delegate = context.coordinator and on the app launch I have the following let audioSession = AVAudioSession.sharedInstance() do { try audioSession.setCategory(AVAudioSession.Category.playback) } catch { print("Setting category to AVAudioSessionCategoryPlayback failed.") } And yes I have the background mode capability enabled for "Audio, AirPlay and Picture in Picture" I'm at a lost here and hope someone can help.
Replies
2
Boosts
0
Views
1.9k
Activity
Dec ’22