mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
remove background audio hack
This commit is contained in:
@@ -32,7 +32,7 @@ set(server_LIBS vcmi)
|
|||||||
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
|
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
|
||||||
set(server_LIBS execinfo ${server_LIBS})
|
set(server_LIBS execinfo ${server_LIBS})
|
||||||
elseif(APPLE_IOS)
|
elseif(APPLE_IOS)
|
||||||
set(server_LIBS ${server_LIBS} "-framework UIKit -framework AVFoundation")
|
set(server_LIBS ${server_LIBS} "-framework UIKit")
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(vcmiserver PRIVATE ${server_LIBS} minizip::minizip)
|
target_link_libraries(vcmiserver PRIVATE ${server_LIBS} minizip::minizip)
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
#import <AVFoundation/AVFoundation.h>
|
|
||||||
|
|
||||||
//#include "StdInc.h"
|
|
||||||
#include "../Global.h"
|
#include "../Global.h"
|
||||||
#include "CVCMIServer.h"
|
#include "CVCMIServer.h"
|
||||||
|
|
||||||
@@ -23,7 +21,6 @@
|
|||||||
|
|
||||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||||
@property (nonatomic, strong) UIWindow *window;
|
@property (nonatomic, strong) UIWindow *window;
|
||||||
@property (nonatomic, strong) AVPlayerLooper *looper;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation AppDelegate
|
@implementation AppDelegate
|
||||||
@@ -34,14 +31,6 @@
|
|||||||
self.window.rootViewController = [ViewController new];
|
self.window.rootViewController = [ViewController new];
|
||||||
[self.window makeKeyAndVisible];
|
[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 detachNewThreadWithBlock:^
|
||||||
{
|
{
|
||||||
NSThread.currentThread.name = @"CVCMIServer";
|
NSThread.currentThread.name = @"CVCMIServer";
|
||||||
|
|||||||
Reference in New Issue
Block a user