tvOS allow audio in other apps, iOS show complete sheet without watch

This commit is contained in:
Trey t
2024-06-19 18:01:51 -05:00
parent 48cc22b3e2
commit bba2ce8603
5 changed files with 29 additions and 11 deletions

View File

@@ -34,6 +34,7 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1C08B2372C234522005F07D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
1CC0930B2C21DE760004E1E6 /* WekoutThotViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WekoutThotViewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
1CC0930E2C21DE760004E1E6 /* WekoutThotViewerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WekoutThotViewerApp.swift; sourceTree = "<group>"; };
1CC093102C21DE760004E1E6 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
@@ -132,6 +133,7 @@
1CC0930D2C21DE760004E1E6 /* WekoutThotViewer */ = {
isa = PBXGroup;
children = (
1C08B2372C234522005F07D1 /* Info.plist */,
1CC0930E2C21DE760004E1E6 /* WekoutThotViewerApp.swift */,
1CC7CB7B2C21E089001614B8 /* RegisteredUser.swift */,
1CC093102C21DE760004E1E6 /* ContentView.swift */,
@@ -387,6 +389,7 @@
DEVELOPMENT_TEAM = V3PF3M6B6U;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = WekoutThotViewer/Info.plist;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UIUserInterfaceStyle = Automatic;
LD_RUNPATH_SEARCH_PATHS = (
@@ -413,6 +416,7 @@
DEVELOPMENT_TEAM = V3PF3M6B6U;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = WekoutThotViewer/Info.plist;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UIUserInterfaceStyle = Automatic;
LD_RUNPATH_SEARCH_PATHS = (

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
</dict>
</plist>

View File

@@ -6,12 +6,16 @@
//
import SwiftUI
import AVKit
@main
struct WekoutThotViewerApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onAppear(perform: {
_ = try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: .mixWithOthers)
})
}
}
}