Save selected subtitle (#702)

This commit is contained in:
Mathias Rasmussen
2016-07-09 03:26:30 +02:00
committed by DC
parent 1668c4c614
commit c15711aae8
4 changed files with 24 additions and 6 deletions

View File

@@ -73,6 +73,15 @@ function renderMedia (state) {
var file = state.getPlayingFileSummary()
file.currentTime = state.playing.currentTime = mediaElement.currentTime
file.duration = state.playing.duration = mediaElement.duration
// Save selected subtitle
if (state.playing.subtitles.selectedIndex !== -1) {
var index = state.playing.subtitles.selectedIndex
file.selectedSubtitle = state.playing.subtitles.tracks[index].filePath
} else if (file.selectedSubtitle != null) {
delete file.selectedSubtitle
}
state.playing.volume = mediaElement.volume
}