mirror of
https://github.com/yattee/yattee.git
synced 2025-10-10 09:28:15 +00:00
check if subtitles are added before removing them
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
@@ -25,7 +25,9 @@ final class MPVBackend: PlayerBackend {
|
||||
var video: Video?
|
||||
var captions: Captions? { didSet {
|
||||
guard let captions else {
|
||||
client?.removeSubs()
|
||||
if client?.areSubtitlesAdded == true {
|
||||
client?.removeSubs()
|
||||
}
|
||||
return
|
||||
}
|
||||
addSubTrack(captions.url)
|
||||
@@ -615,7 +617,9 @@ final class MPVBackend: PlayerBackend {
|
||||
}
|
||||
|
||||
func addSubTrack(_ url: URL) {
|
||||
client?.removeSubs()
|
||||
if client?.areSubtitlesAdded == true {
|
||||
client?.removeSubs()
|
||||
}
|
||||
client?.addSubTrack(url)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user