mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added SupportsExternalStream to MediaStream
This commit is contained in:
parent
fc8386bd9c
commit
002139addb
3 changed files with 44 additions and 25 deletions
|
@ -143,6 +143,10 @@
|
|||
self.changeStream(self.getCurrentTicks(), { AudioStreamIndex: index });
|
||||
};
|
||||
|
||||
self.supportsSubtitleStreamExternally = function (stream) {
|
||||
return stream.Type == 'Subtitle' && stream.IsTextSubtitleStream && stream.SupportsExternalStream;
|
||||
}
|
||||
|
||||
self.setSubtitleStreamIndex = function (index) {
|
||||
|
||||
if (!self.supportsTextTracks()) {
|
||||
|
@ -162,7 +166,7 @@
|
|||
|
||||
if (currentStream && !newStream) {
|
||||
|
||||
if (!currentStream.IsTextSubtitleStream) {
|
||||
if (!self.supportsSubtitleStreamExternally(currentStream)) {
|
||||
|
||||
// Need to change the transcoded stream to remove subs
|
||||
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 });
|
||||
|
@ -170,7 +174,7 @@
|
|||
}
|
||||
else if (!currentStream && newStream) {
|
||||
|
||||
if (newStream.IsTextSubtitleStream) {
|
||||
if (self.supportsSubtitleStreamExternally(newStream)) {
|
||||
selectedTrackElementIndex = index;
|
||||
} else {
|
||||
|
||||
|
@ -180,10 +184,10 @@
|
|||
}
|
||||
else if (currentStream && newStream) {
|
||||
|
||||
if (newStream.IsTextSubtitleStream) {
|
||||
if (self.supportsSubtitleStreamExternally(newStream)) {
|
||||
selectedTrackElementIndex = index;
|
||||
|
||||
if (!currentStream.IsTextSubtitleStream) {
|
||||
if (!self.supportsSubtitleStreamExternally(currentStream)) {
|
||||
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 });
|
||||
}
|
||||
} else {
|
||||
|
@ -203,7 +207,7 @@
|
|||
var modes = ['disabled', 'showing', 'hidden'];
|
||||
|
||||
var textStreams = self.currentMediaSource.MediaStreams.filter(function (s) {
|
||||
return s.Type == 'Subtitle' && s.IsTextSubtitleStream;
|
||||
return self.supportsSubtitleStreamExternally(s);
|
||||
});
|
||||
|
||||
var newStream = textStreams.filter(function (s) {
|
||||
|
@ -1025,7 +1029,7 @@
|
|||
mediaSourceId: mediaSource.Id
|
||||
};
|
||||
|
||||
if (selectedSubtitleStream && (!selectedSubtitleStream.IsTextSubtitleStream || !self.supportsTextTracks())) {
|
||||
if (selectedSubtitleStream && (!self.supportsSubtitleStreamExternally(selectedSubtitleStream) || !self.supportsTextTracks())) {
|
||||
baseParams.SubtitleStreamIndex = mediaSource.DefaultSubtitleStreamIndex;
|
||||
}
|
||||
|
||||
|
@ -1136,7 +1140,7 @@
|
|||
|
||||
if (self.supportsTextTracks()) {
|
||||
var textStreams = subtitleStreams.filter(function (s) {
|
||||
return s.IsTextSubtitleStream;
|
||||
return self.supportsSubtitleStreamExternally(s);
|
||||
});
|
||||
|
||||
for (var i = 0, length = textStreams.length; i < length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue