1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Always try transcode as last resort

This commit is contained in:
gnattu 2024-05-28 05:45:29 +08:00
parent 2b59a9f998
commit 20e29b81b5

View file

@ -3296,18 +3296,21 @@ class PlaybackManager {
const streamInfo = error.streamInfo || getPlayerData(player).streamInfo;
if (streamInfo?.url) {
const isAlreadyFallbacking = streamInfo.url.toLowerCase().includes('transcodereasons=directplayerror');
const currentlyPreventsVideoStreamCopy = streamInfo.url.toLowerCase().indexOf('allowvideostreamcopy=false') !== -1;
const currentlyPreventsAudioStreamCopy = streamInfo.url.toLowerCase().indexOf('allowaudiostreamcopy=false') !== -1;
// Auto switch to transcoding
if (enablePlaybackRetryWithTranscoding(streamInfo, errorType, currentlyPreventsVideoStreamCopy, currentlyPreventsAudioStreamCopy)) {
const startTime = getCurrentTicks(player) || streamInfo.playerStartPositionTicks;
const isRemoteSource = streamInfo.item.LocationType === 'Remote';
// force transcoding and only allow remuxing for remote source like liveTV, but only for initial trial
const tryVideoStreamCopy = isRemoteSource && !isAlreadyFallbacking;
changeStream(player, startTime, {
// force transcoding and only allow remuxing for remote source like liveTV
EnableDirectPlay: false,
EnableDirectStream: false,
AllowVideoStreamCopy: streamInfo.item.LocationType === 'Remote',
AllowVideoStreamCopy: tryVideoStreamCopy,
AllowAudioStreamCopy: currentlyPreventsAudioStreamCopy || currentlyPreventsVideoStreamCopy ? false : null
});