浏览代码

Merge pull request #12697 from volzhs/dont-stop-music

Prevent to stop music in another background app on iOS
Rémi Verschelde 7 年之前
父节点
当前提交
9493d7b218
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      platform/iphone/app_delegate.mm

+ 3 - 0
platform/iphone/app_delegate.mm

@@ -632,6 +632,9 @@ static int frame_count = 0;
 
 	mainViewController = view_controller;
 
+	// prevent to stop music in another background app
+	[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
+
 #ifdef MODULE_GAME_ANALYTICS_ENABLED
 	printf("********************* didFinishLaunchingWithOptions\n");
 	if (!Globals::get_singleton()->has("mobileapptracker/advertiser_id")) {