mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update bitrate detection
This commit is contained in:
parent
0e6672699e
commit
8c248c229a
10 changed files with 77 additions and 44 deletions
|
@ -451,6 +451,10 @@
|
|||
Format: 'pgssub',
|
||||
Method: 'Embed'
|
||||
});
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'dvdsub',
|
||||
Method: 'Embed'
|
||||
});
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'vtt',
|
||||
Method: 'Embed'
|
||||
|
@ -988,6 +992,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
var lastBitrateDetect = 0;
|
||||
|
||||
self.playInternal = function (item, startPosition, callback) {
|
||||
|
||||
if (item == null) {
|
||||
|
@ -1008,7 +1014,28 @@
|
|||
return;
|
||||
}
|
||||
|
||||
var deviceProfile = self.getDeviceProfile();
|
||||
if (item.MediaType == 'Video' && AppSettings.enableAutomaticBitrateDetection() && (new Date().getTime() - lastBitrateDetect) > 1000) {
|
||||
|
||||
Dashboard.showModalLoadingMsg();
|
||||
|
||||
ApiClient.detectBitrate().done(function (bitrate) {
|
||||
|
||||
Logger.log('Max bitrate auto detected to ' + bitrate);
|
||||
lastBitrateDetect = new Date().getTime();
|
||||
AppSettings.maxStreamingBitrate(bitrate);
|
||||
|
||||
playOnDeviceProfileCreated(self.getDeviceProfile(), item, startPosition, callback);
|
||||
}).fail(function () {
|
||||
|
||||
playOnDeviceProfileCreated(self.getDeviceProfile(), item, startPosition, callback);
|
||||
});
|
||||
|
||||
} else {
|
||||
playOnDeviceProfileCreated(self.getDeviceProfile(), item, startPosition, callback);
|
||||
}
|
||||
};
|
||||
|
||||
function playOnDeviceProfileCreated(deviceProfile, item, startPosition, callback) {
|
||||
|
||||
if (item.MediaType === "Video") {
|
||||
|
||||
|
@ -1040,9 +1067,8 @@
|
|||
MediaController.showPlaybackInfoErrorMessage('NoCompatibleStream');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function playInternalPostMediaSourceSelection(item, mediaSource, startPosition, callback) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue