Skip to content

Commit

Permalink
if no match is found, grab first media source. Fix iOS progress issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhays committed Aug 17, 2023
1 parent 75cd55b commit 5442eb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ extension BaseItemDto {
}
}
}
if matchingMediaSource == nil && !responseMediaSources.isEmpty {
// Didn't find a match, but maybe we can just grab the first item in the response
matchingMediaSource = responseMediaSources.first
}
}
guard let matchingMediaSource else {
throw JellyfinAPIError("Matching media source not in playback info")
Expand Down
3 changes: 3 additions & 0 deletions Swiftfin/Views/VideoPlayer/VideoPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ struct VideoPlayer: View {
.environment(\.subtitleOffset, $subtitleOffset)
}
.onChange(of: videoPlayerManager.currentProgressHandler.scrubbedProgress) { newValue in
guard !newValue.isNaN && !newValue.isInfinite else {
return
}
DispatchQueue.main.async {
videoPlayerManager.currentProgressHandler
.scrubbedSeconds = Int(CGFloat(videoPlayerManager.currentViewModel.item.runTimeSeconds) * newValue)
Expand Down

0 comments on commit 5442eb3

Please sign in to comment.