回答編集履歴

2

変更

2019/01/23 01:54

投稿

hahum
hahum

スコア65

test CHANGED
@@ -1,7 +1,33 @@
1
- takabosoftさんの
1
+ takabosoftさんのご回答
2
2
 
3
3
  try! AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient, mode: .default)
4
4
 
5
5
 
6
6
 
7
7
  で解決することができました。ありがとうございます。
8
+
9
+ ```swift4
10
+
11
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
12
+
13
+ //バックグラウンドで音楽再生
14
+
15
+ do {
16
+
17
+ try! AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient, mode: .default)
18
+
19
+ } catch {
20
+
21
+ print(error)
22
+
23
+ }
24
+
25
+
26
+
27
+
28
+
29
+ return true
30
+
31
+ }
32
+
33
+ ```

1

k

2019/01/23 01:54

投稿

hahum
hahum

スコア65

test CHANGED
@@ -1,5 +1,7 @@
1
+ takabosoftさんの
2
+
1
- https://qiita.com/taka000826/items/2188f8f20e31af11efce
3
+ try! AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient, mode: .default)
2
4
 
3
5
 
4
6
 
5
- を参考にして同時再生することができました。
7
+ で解決することができました。ありがとうございます。