Skip to content

Commit 108240d

Browse files
authored
Merge pull request #839 from zhannao456/fix_local_subtitle
fix open local subtitle
2 parents c8d1b3a + 33d7c21 commit 108240d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/KSPlayer/SwiftUI/KSVideoPlayerView.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,12 @@ public struct KSVideoPlayerView: View {
303303

304304
public func openURL(_ url: URL) {
305305
runOnMainThread {
306-
if url.isAudio || url.isMovie {
307-
self.url = url
308-
title = url.lastPathComponent
309-
} else {
306+
if url.isSubtitle {
310307
let info = URLSubtitleInfo(url: url)
311308
playerCoordinator.subtitleModel.selectedSubtitleInfo = info
309+
} else if url.isAudio || url.isMovie {
310+
self.url = url
311+
title = url.lastPathComponent
312312
}
313313
}
314314
}

0 commit comments

Comments
 (0)