Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AVAudioSessionCategoryPlayback未按预期工作_Ios_Video_Avaudiosessioncategory - Fatal编程技术网

AVAudioSessionCategoryPlayback未按预期工作

AVAudioSessionCategoryPlayback未按预期工作,ios,video,avaudiosessioncategory,Ios,Video,Avaudiosessioncategory,在我的应用程序中,我在UITableViewCell中播放视频,并将AVAudioSessionCategory设置为AVAudioSessionCategoryPlayback,即使静音开关打开,它也能正常工作。我唯一的问题是,如果一些音乐在后台运行,并且我打开我的应用程序,即使我的视频是静音的,背景音乐也会停止。我如何让它像这样工作?youtube/facebook应用程序可以做到这一点。有人知道如何解决这个问题吗 这是我的密码 BOOL success = [[AVAudioSession

在我的应用程序中,我在
UITableViewCell
中播放视频,并将
AVAudioSessionCategory
设置为
AVAudioSessionCategoryPlayback
,即使静音开关打开,它也能正常工作。我唯一的问题是,如果一些音乐在后台运行,并且我打开我的应用程序,即使我的视频是静音的,背景音乐也会停止。我如何让它像这样工作?youtube/facebook应用程序可以做到这一点。有人知道如何解决这个问题吗

这是我的密码

BOOL success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error];
        [[AVAudioSession sharedInstance] setActive:YES error:nil];

        if (!success) {
            NSLog(@"SetCategory error:%@ ",error.description);
        }