Merge branch 'main' into theme-setting
This commit is contained in:
commit
1398d6cac0
|
@ -111,6 +111,7 @@ struct ConnectToServerView: View {
|
|||
TextField(NSLocalizedString("Server URL", comment: ""), text: $uri)
|
||||
.disableAutocorrection(true)
|
||||
.autocapitalization(.none)
|
||||
.keyboardType(.URL)
|
||||
Button {
|
||||
viewModel.connectToServer()
|
||||
} label: {
|
||||
|
|
|
@ -22,6 +22,11 @@
|
|||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>UILaunchScreen</key>
|
||||
<dict/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
|
|
|
@ -109,6 +109,7 @@ struct ConnectToServerView: View {
|
|||
TextField(NSLocalizedString("Server URL", comment: ""), text: $uri)
|
||||
.disableAutocorrection(true)
|
||||
.autocapitalization(.none)
|
||||
.keyboardType(.URL)
|
||||
Button {
|
||||
viewModel.connectToServer()
|
||||
} label: {
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
<key>NSAllowsLocalNetworking</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>${PRODUCT_NAME} uses Bluetooth to discover nearby Cast devices.</string>
|
||||
|
|
|
@ -34,7 +34,7 @@ struct ItemView: View {
|
|||
.statusBar(hidden: true)
|
||||
.edgesIgnoringSafeArea(.all)
|
||||
.prefersHomeIndicatorAutoHidden(true)
|
||||
}.supportedOrientations(.landscape), isActive: $videoPlayerItem.shouldShowPlayer) {
|
||||
}, isActive: $videoPlayerItem.shouldShowPlayer) {
|
||||
EmptyView()
|
||||
}
|
||||
VStack {
|
||||
|
@ -56,7 +56,6 @@ struct ItemView: View {
|
|||
.navigationBarHidden(false)
|
||||
.navigationBarBackButtonHidden(false)
|
||||
.environmentObject(videoPlayerItem)
|
||||
.supportedOrientations(.all)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,6 +209,8 @@ class EmailHelper: NSObject, MFMailComposeViewControllerDelegate {
|
|||
|
||||
@main
|
||||
struct JellyfinPlayerApp: App {
|
||||
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
||||
|
||||
let persistenceController = PersistenceController.shared
|
||||
|
||||
var body: some Scene {
|
||||
|
@ -224,3 +226,12 @@ struct JellyfinPlayerApp: App {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
|
||||
static var orientationLock = UIInterfaceOrientationMask.all
|
||||
|
||||
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
|
||||
AppDelegate.orientationLock
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ struct SettingsView: View {
|
|||
})
|
||||
}
|
||||
|
||||
Section {
|
||||
Section(header: Text(ServerEnvironment.current.server.name ?? "")) {
|
||||
HStack {
|
||||
Text("Signed in as \(username)").foregroundColor(.primary)
|
||||
Spacer()
|
||||
|
|
|
@ -81,7 +81,7 @@ class PlayerViewController: UIViewController, GCKDiscoveryManagerListener, GCKRe
|
|||
var playbackItem = PlaybackItem()
|
||||
var remoteTimeUpdateTimer: Timer?
|
||||
var upNextViewModel: UpNextViewModel = UpNextViewModel()
|
||||
var lastOri: UIDeviceOrientation!
|
||||
var lastOri: UIInterfaceOrientation!
|
||||
|
||||
// MARK: IBActions
|
||||
@IBAction func seekSliderStart(_ sender: Any) {
|
||||
|
@ -387,6 +387,7 @@ class PlayerViewController: UIViewController, GCKDiscoveryManagerListener, GCKRe
|
|||
|
||||
// MARK: viewDidLoad
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
if manifest.type == "Movie" {
|
||||
titleLabel.text = manifest.name ?? ""
|
||||
} else {
|
||||
|
@ -396,14 +397,21 @@ class PlayerViewController: UIViewController, GCKDiscoveryManagerListener, GCKRe
|
|||
upNextViewModel.delegate = self
|
||||
}
|
||||
|
||||
lastOri = UIDevice.current.orientation
|
||||
DispatchQueue.main.async {
|
||||
self.lastOri = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation
|
||||
AppDelegate.orientationLock = .landscape
|
||||
|
||||
if !UIDevice.current.orientation.isLandscape || UIDevice.current.orientation.isFlat {
|
||||
let value = UIInterfaceOrientation.landscapeRight.rawValue
|
||||
UIDevice.current.setValue(value, forKey: "orientation")
|
||||
if !self.lastOri.isLandscape {
|
||||
UIDevice.current.setValue(UIInterfaceOrientation.landscapeRight.rawValue, forKey: "orientation")
|
||||
UIViewController.attemptRotationToDeviceOrientation()
|
||||
}
|
||||
super.viewDidLoad()
|
||||
}
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(didChangedOrientation), name: UIDevice.orientationDidChangeNotification, object: nil)
|
||||
}
|
||||
|
||||
@objc func didChangedOrientation() {
|
||||
lastOri = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation
|
||||
}
|
||||
|
||||
func mediaHasStartedPlaying() {
|
||||
|
@ -438,12 +446,15 @@ class PlayerViewController: UIViewController, GCKDiscoveryManagerListener, GCKRe
|
|||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
self.tabBarController?.tabBar.isHidden = false
|
||||
self.navigationController?.isNavigationBarHidden = false
|
||||
overrideUserInterfaceStyle = .unspecified
|
||||
UIDevice.current.setValue(lastOri.rawValue, forKey: "orientation")
|
||||
DispatchQueue.main.async {
|
||||
AppDelegate.orientationLock = .all
|
||||
UIDevice.current.setValue(self.lastOri.rawValue, forKey: "orientation")
|
||||
UIViewController.attemptRotationToDeviceOrientation()
|
||||
super.viewWillDisappear(animated)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: viewDidAppear
|
||||
|
|
24
README.md
24
README.md
|
@ -1,6 +1,9 @@
|
|||
<p align="center">
|
||||
<img alt="SwiftFin" height="125" src="https://github.com/jellyfin/SwiftFin/raw/main/JellyfinPlayer/Assets.xcassets/AppIcon.appiconset/152.png">
|
||||
<h2 align="center">SwiftFin</h2>
|
||||
<a href="https://translate.jellyfin.org/engage/swiftfin/">
|
||||
<img src="https://translate.jellyfin.org/widgets/swiftfin/-/svg-badge.svg"/>
|
||||
</a>
|
||||
<a href="https://matrix.to/#/+jellyfin:matrix.org">
|
||||
<img src="https://img.shields.io/matrix/jellyfin:matrix.org">
|
||||
</a>
|
||||
|
@ -19,6 +22,27 @@
|
|||
|
||||
<a href='https://testflight.apple.com/join/WiN0G62Q'><img height='70' alt='Join the Beta on TestFlight' src='https://anotherlens.app/testflight-badge.png'/></a>
|
||||
|
||||
**Don't see SwiftFin in your language?**
|
||||
|
||||
Check out our [Weblate instance](https://translate.jellyfin.org/projects/swiftfin/) to help translate SwiftFin and other projects.
|
||||
|
||||
<a href="https://translate.jellyfin.org/engage/swiftfin/">
|
||||
<img src="https://translate.jellyfin.org/widgets/swiftfin/-/multi-auto.svg"/>
|
||||
</a>
|
||||
|
||||
## ⚙️ Development
|
||||
|
||||
Xcode 13.0 with command line tools.
|
||||
|
||||
### Build Process
|
||||
|
||||
```bash
|
||||
# install Cocoapods (if not installed)
|
||||
$ sudo gem install cocoapods
|
||||
|
||||
# install dependencies
|
||||
$ pod install
|
||||
|
||||
# open workspace and build it
|
||||
$ open JellyfinPlayer.xcworkspace
|
||||
```
|
Binary file not shown.
Loading…
Reference in New Issue