gpt4 book ai didi

ios - 音量 slider 没有效果

转载 作者:行者123 更新时间:2023-11-29 13:22:53 30 4
gpt4 key购买 nike

我正在创建一个带有播放、暂停和音量 slider 的广播流媒体应用。

我已经使用 MPVolumeView 实现了音量 slider ,但遗憾的是它无法正常工作。

任何人都可以告诉我正确的代码,以便音量 slider 可以在我的应用程序中工作。我用过MPMoviePlayerControllerAVPlayerAVAudioPlayer

最佳答案

听起来好像您错过了 Apple 文档的重要部分; Working with Movies and iPod Music

我怀疑您同时使用了 AVAudioPlayerMPMoviePlayerController 并且您已经设置了一些 Audio Session 属性以使其正常工作。现在这样做时,您可能想告诉 MPMoviePlayerController 使用/不使用该 session 。

Using the Media Player Framework Exclusively

If your application is using a movie player only, or a music player only—and you are not playing your own sounds—then you should not configure an audio session.

If you are using a movie player exclusively, you must tell it to use its own audio session, as follows:

myMoviePlayer.useApplicationAudioSession = NO

If you are using a movie player and a music player, then you probably want to configure how the two interact; for this, you must configure an audio session, even though you are not playing application audio per se. Use the guidance in Table 6-1.

enter image description here

关于ios - 音量 slider 没有效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13945247/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com