Merge branch 'Jellyfin/main' into PangMo5/refactoring

This commit is contained in:
PangMo5 2021-06-15 22:53:59 +09:00
commit 50ff0ceac8
2 changed files with 9 additions and 3 deletions

View File

@ -299,6 +299,12 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
print(result)
}, receiveValue: { [self] response in
playSessionId = response.playSessionId ?? ""
if(response.mediaSources == nil) {
delegate?.exitPlayer(self)
return
}
let mediaSource = response.mediaSources!.first.self!
if mediaSource.transcodingUrl != nil {
// Item is being transcoded by request of server
@ -498,7 +504,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
self.videoControlsView.isHidden = true
self.videoControlsView.alpha = 1
})
controlsAppearTime = 10000000000000000000000
controlsAppearTime = 999_999_999_999_999
}
} else {
paused = true

View File

@ -107,7 +107,7 @@ extension BaseItemDto {
// MARK: Calculations
func getItemRuntime() -> String {
let seconds: Int = Int(self.runTimeTicks!) / 10_000_000
let seconds: Int = Int(self.runTimeTicks ?? 0) / 10_000_000
let hours = (seconds / 3600)
let minutes = ((seconds - (hours * 3600)) / 60)
if hours != 0 {
@ -122,7 +122,7 @@ extension BaseItemDto {
return ""
}
let remainingSecs = Int(self.runTimeTicks! - (self.userData?.playbackPositionTicks!)!) / 10_000_000
let remainingSecs = Int(self.runTimeTicks ?? 0 - (self.userData?.playbackPositionTicks ?? 0)) / 10_000_000
let proghours = Int(remainingSecs / 3600)
let progminutes = Int((Int(remainingSecs) - (proghours * 3600)) / 60)
if proghours != 0 {