mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
remove background audio hack
This commit is contained in:
parent
93e9bc4e51
commit
09f5ea52f2
@ -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)
|
||||
|
||||
|
@ -8,9 +8,7 @@
|
||||
*
|
||||
*/
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
|
||||
//#include "StdInc.h"
|
||||
#include "../Global.h"
|
||||
#include "CVCMIServer.h"
|
||||
|
||||
@ -23,7 +21,6 @@
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
@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";
|
||||
|
Loading…
Reference in New Issue
Block a user