From 09f5ea52f2c9e9cd8c4475d505c77ff340b02235 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Tue, 9 Mar 2021 11:12:17 +0300 Subject: [PATCH] remove background audio hack --- server/CMakeLists.txt | 2 +- server/main_ios.mm | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 61d06ded4..c6eb684e3 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -32,7 +32,7 @@ set(server_LIBS vcmi) if(CMAKE_SYSTEM_NAME MATCHES FreeBSD) set(server_LIBS execinfo ${server_LIBS}) elseif(APPLE_IOS) - set(server_LIBS ${server_LIBS} "-framework UIKit -framework AVFoundation") + set(server_LIBS ${server_LIBS} "-framework UIKit") endif() target_link_libraries(vcmiserver PRIVATE ${server_LIBS} minizip::minizip) diff --git a/server/main_ios.mm b/server/main_ios.mm index ec28d8c64..4576ed683 100644 --- a/server/main_ios.mm +++ b/server/main_ios.mm @@ -8,9 +8,7 @@ * */ #import -#import -//#include "StdInc.h" #include "../Global.h" #include "CVCMIServer.h" @@ -23,7 +21,6 @@ @interface AppDelegate : UIResponder @property (nonatomic, strong) UIWindow *window; -@property (nonatomic, strong) AVPlayerLooper *looper; @end @implementation AppDelegate @@ -34,14 +31,6 @@ self.window.rootViewController = [ViewController new]; [self.window makeKeyAndVisible]; - [AVAudioSession.sharedInstance setCategory:AVAudioSessionCategoryPlayback mode:AVAudioSessionModeDefault options:AVAudioSessionCategoryOptionMixWithOthers error:nullptr]; - - auto item = [AVPlayerItem playerItemWithURL:[NSBundle.mainBundle URLForResource:@"silence" withExtension:@"wav"]]; - auto player = [AVQueuePlayer new]; - player.allowsExternalPlayback = NO; - [player play]; - self.looper = [AVPlayerLooper playerLooperWithPlayer:player templateItem:item]; - [NSThread detachNewThreadWithBlock:^ { NSThread.currentThread.name = @"CVCMIServer";