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

Merge pull request #5617 from gnattu/relax-remux-requirement-for-remote

Allow VideoStreamCopy for remote source fallback
This commit is contained in:
Bill Thornton 2024-05-30 11:11:57 -04:00 committed by GitHub
commit 40e7dc9007
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

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');
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
EnableDirectPlay: false,
EnableDirectStream: false,
AllowVideoStreamCopy: false,
EnableDirectStream: tryVideoStreamCopy,
AllowVideoStreamCopy: tryVideoStreamCopy,
AllowAudioStreamCopy: currentlyPreventsAudioStreamCopy || currentlyPreventsVideoStreamCopy ? false : null
});

View file

@ -6,6 +6,6 @@ import type { MediaSourceInfo } from '@jellyfin/sdk/lib/generated-client';
* @returns _true_ if the media source is an HLS stream, _false_ otherwise.
*/
export function isHls(mediaSource: MediaSourceInfo|null|undefined): boolean {
const protocol = mediaSource?.TranscodingSubProtocol || mediaSource?.Container;
return protocol?.toUpperCase() === 'HLS';
return mediaSource?.TranscodingSubProtocol?.toUpperCase() === 'HLS'
|| mediaSource?.Container?.toUpperCase() === 'HLS';
}