player fixes
This commit is contained in:
parent
4801b01b16
commit
c86c08d4bb
|
@ -136,7 +136,8 @@ class PreferenceUIHostingController: UIHostingController<AnyView> {
|
||||||
// MARK: Lock orientation
|
// MARK: Lock orientation
|
||||||
|
|
||||||
public var _orientations: UIInterfaceOrientationMask = .allButUpsideDown {
|
public var _orientations: UIInterfaceOrientationMask = .allButUpsideDown {
|
||||||
didSet { UIViewController.attemptRotationToDeviceOrientation();
|
didSet {
|
||||||
|
UIViewController.attemptRotationToDeviceOrientation();
|
||||||
if(_orientations == .landscapeRight) {
|
if(_orientations == .landscapeRight) {
|
||||||
let value = UIInterfaceOrientation.landscapeRight.rawValue;
|
let value = UIInterfaceOrientation.landscapeRight.rawValue;
|
||||||
UIDevice.current.setValue(value, forKey: "orientation")
|
UIDevice.current.setValue(value, forKey: "orientation")
|
||||||
|
|
|
@ -355,10 +355,10 @@ struct EpisodeItemView: View {
|
||||||
WebImage(url: cast.Image)
|
WebImage(url: cast.Image)
|
||||||
.resizable() // Resizable like SwiftUI.Image, you must use this modifier or the view will use the image bitmap size
|
.resizable() // Resizable like SwiftUI.Image, you must use this modifier or the view will use the image bitmap size
|
||||||
.placeholder {
|
.placeholder {
|
||||||
Image(uiImage: UIImage(blurHash: (cast.ImageBlurHash == "" ? "W$H.4}D%bdo#a#xbtpxVW?W?jXWsXVt7Rjf5axWqxbWXnhada{s-" : cast.ImageBlurHash), size: CGSize(width: 32, height: 32))!)
|
Image(uiImage: UIImage(blurHash: (cast.ImageBlurHash == "" ? "W$H.4}D%bdo#a#xbtpxVW?W?jXWsXVt7Rjf5axWqxbWXnhada{s-" : cast.ImageBlurHash), size: CGSize(width: 4, height: 4))!)
|
||||||
.resizable()
|
.resizable()
|
||||||
.aspectRatio(contentMode: .fill)
|
.aspectRatio(contentMode: .fill)
|
||||||
.frame(width: 100, height: 100)
|
.frame(width: 70, height: 70)
|
||||||
.cornerRadius(10)
|
.cornerRadius(10)
|
||||||
}
|
}
|
||||||
.aspectRatio(contentMode: .fill)
|
.aspectRatio(contentMode: .fill)
|
||||||
|
@ -596,7 +596,7 @@ struct EpisodeItemView: View {
|
||||||
}.introspectTabBarController { (UITabBarController) in
|
}.introspectTabBarController { (UITabBarController) in
|
||||||
UITabBarController.tabBar.isHidden = true
|
UITabBarController.tabBar.isHidden = true
|
||||||
}
|
}
|
||||||
}.onAppear(perform: loadData)
|
}.onAppear(perform: loadData).supportedOrientations(.allButUpsideDown)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,7 @@ struct JellyfinPlayerApp: App {
|
||||||
.environmentObject(OrientationInfo())
|
.environmentObject(OrientationInfo())
|
||||||
.environmentObject(jsi)
|
.environmentObject(jsi)
|
||||||
.withHostingWindow() { window in
|
.withHostingWindow() { window in
|
||||||
window?.rootViewController = PreferenceUIHostingController(wrappedView: ContentView().environment(\.managedObjectContext, persistenceController.container.viewContext)
|
window?.rootViewController = PreferenceUIHostingController(wrappedView: ContentView().environment(\.managedObjectContext, persistenceController.container.viewContext).environmentObject(OrientationInfo()).environmentObject(jsi))
|
||||||
.environmentObject(jsi).environmentObject(OrientationInfo()))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -401,14 +401,14 @@ struct MovieItemView: View {
|
||||||
WebImage(url: cast.Image)
|
WebImage(url: cast.Image)
|
||||||
.resizable() // Resizable like SwiftUI.Image, you must use this modifier or the view will use the image bitmap size
|
.resizable() // Resizable like SwiftUI.Image, you must use this modifier or the view will use the image bitmap size
|
||||||
.placeholder {
|
.placeholder {
|
||||||
Image(uiImage: UIImage(blurHash: (cast.ImageBlurHash == "" ? "W$H.4}D%bdo#a#xbtpxVW?W?jXWsXVt7Rjf5axWqxbWXnhada{s-" : cast.ImageBlurHash), size: CGSize(width: 32, height: 32))!)
|
Image(uiImage: UIImage(blurHash: (cast.ImageBlurHash == "" ? "W$H.4}D%bdo#a#xbtpxVW?W?jXWsXVt7Rjf5axWqxbWXnhada{s-" : cast.ImageBlurHash), size: CGSize(width: 4, height: 4))!)
|
||||||
.resizable()
|
.resizable()
|
||||||
.aspectRatio(contentMode: .fill)
|
.aspectRatio(contentMode: .fill)
|
||||||
.frame(width: 100, height: 100)
|
.frame(width: 70, height: 70)
|
||||||
.cornerRadius(10)
|
.cornerRadius(10)
|
||||||
}
|
}
|
||||||
.aspectRatio(contentMode: .fill)
|
.aspectRatio(contentMode: .fill)
|
||||||
.frame(width: 100, height: 100)
|
.frame(width: 70, height: 70)
|
||||||
.cornerRadius(10).shadow(radius: 6)
|
.cornerRadius(10).shadow(radius: 6)
|
||||||
Text(cast.Name).font(.footnote).fontWeight(.regular).lineLimit(1).frame(width: 100).foregroundColor(Color.primary)
|
Text(cast.Name).font(.footnote).fontWeight(.regular).lineLimit(1).frame(width: 100).foregroundColor(Color.primary)
|
||||||
if(cast.Role != "") {
|
if(cast.Role != "") {
|
||||||
|
@ -641,7 +641,7 @@ struct MovieItemView: View {
|
||||||
}.introspectTabBarController { (UITabBarController) in
|
}.introspectTabBarController { (UITabBarController) in
|
||||||
UITabBarController.tabBar.isHidden = false
|
UITabBarController.tabBar.isHidden = false
|
||||||
}
|
}
|
||||||
}.onAppear(perform: loadData)
|
}.onAppear(perform: loadData).supportedOrientations(.allButUpsideDown)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,8 +374,9 @@ struct VideoPlayerView: View {
|
||||||
VLCPlayer(url: $pbitem, player: $vlcplayer, startTime: Int(item.Progress)).onDisappear(perform: {
|
VLCPlayer(url: $pbitem, player: $vlcplayer, startTime: Int(item.Progress)).onDisappear(perform: {
|
||||||
_isPlaying.wrappedValue = false;
|
_isPlaying.wrappedValue = false;
|
||||||
vlcplayer.stop()
|
vlcplayer.stop()
|
||||||
})
|
}).padding(EdgeInsets(top: 0, leading: UIDevice.current.hasNotch ? 30 : 0, bottom: 0, trailing: UIDevice.current.hasNotch ? 30 : 0))
|
||||||
}.overlay(
|
}
|
||||||
|
.overlay(
|
||||||
VStack() {
|
VStack() {
|
||||||
HStack() {
|
HStack() {
|
||||||
HStack() {
|
HStack() {
|
||||||
|
@ -459,7 +460,6 @@ struct VideoPlayerView: View {
|
||||||
Text(timeText).fontWeight(.semibold).frame(width: 80).foregroundColor(.white)
|
Text(timeText).fontWeight(.semibold).frame(width: 80).foregroundColor(.white)
|
||||||
}.padding(EdgeInsets(top: -20, leading: 44, bottom: 42, trailing: 40))
|
}.padding(EdgeInsets(top: -20, leading: 44, bottom: 42, trailing: 40))
|
||||||
}
|
}
|
||||||
.padding(EdgeInsets(top: 0, leading: UIDevice.current.hasNotch ? -30 : 0, bottom: 0, trailing: UIDevice.current.hasNotch ? -30 : 0))
|
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
.background(Color(.black).opacity(0.4))
|
.background(Color(.black).opacity(0.4))
|
||||||
.isHidden(inactivity)
|
.isHidden(inactivity)
|
||||||
|
@ -469,12 +469,13 @@ struct VideoPlayerView: View {
|
||||||
.navigationBarHidden(true)
|
.navigationBarHidden(true)
|
||||||
.navigationBarBackButtonHidden(true)
|
.navigationBarBackButtonHidden(true)
|
||||||
.prefersHomeIndicatorAutoHidden(true)
|
.prefersHomeIndicatorAutoHidden(true)
|
||||||
|
.edgesIgnoringSafeArea(.all)
|
||||||
|
.supportedOrientations(.landscapeRight)
|
||||||
.preferredColorScheme(.dark)
|
.preferredColorScheme(.dark)
|
||||||
.introspectTabBarController { (UITabBarController) in
|
.introspectTabBarController { (UITabBarController) in
|
||||||
UITabBarController.tabBar.isHidden = true
|
UITabBarController.tabBar.isHidden = true
|
||||||
}
|
}
|
||||||
.statusBar(hidden: true)
|
.statusBar(hidden: true)
|
||||||
.edgesIgnoringSafeArea(.all)
|
|
||||||
.onTapGesture(perform: resetTimer)
|
.onTapGesture(perform: resetTimer)
|
||||||
.fullScreenCover(isPresented: self.$captionConfiguration) {
|
.fullScreenCover(isPresented: self.$captionConfiguration) {
|
||||||
NavigationView() {
|
NavigationView() {
|
||||||
|
|
Loading…
Reference in New Issue