简体   繁体   English

AVAudioSession更改类别冻结AVCapture屏幕

[英]AVAudioSession Changing Category Freezing AVCapture Screen

We want to continue playing your music from other apps while you capture video for our ios app. 我们希望在您为ios应用程序捕获视频时继续播放其他应用程序中的音乐。 Our code is modeled like the solution the question linked below, setting up the audio session when we go into and out of our capture screen. 我们的代码建模类似于下面链接的问题解决方案,当我们进入和退出捕获屏幕时设置音频会话。

How do I make AVCaptureSession and AVPlayer respect AVAudioSessionCategoryAmbient? 如何让AVCaptureSession和AVPlayer尊重AVAudioSessionCategoryAmbient?

The issue is that the app freezes up a lot when going from one of our views with an AVPlayer -> capture and then refuses to capture, but this only occurs on the iphone 5s. 问题是,当我们使用AVPlayer从我们的一个视图中获取时,应用程序会冻结很多 - >捕获然后拒绝捕获,但这只发生在iphone 5s上。 We confirmed it works correctly on both the 4s and 6s. 我们确认它在4s和6s上都能正常工作。

Is there something else we are missing that might need to be added to get this working? 还有其他我们遗漏的东西可能需要添加才能使其正常工作吗? We are investigating the possibility of the AVPlayer sticking around too long and that being why our app's capture screen stops functioning correctly when switching to it. 我们正在调查AVPlayer粘贴太久的可能性,这就是为什么我们的应用程序的捕获屏幕在切换到它时会停止正常运行的原因。

The primary issue here was making sure that we paused running video before switching the audio session, changing the session, then start the video capture. 这里的主要问题是确保我们在切换音频会话,更改会话,然后开始视频捕获之前暂停运行视频。 This order wasn't always guaranteed before in our flow. 在我们的流程中,此订单并不总是得到保证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM