mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Backport pull request #5617 from jellyfin-web/release-10.9.z
Allow VideoStreamCopy for remote source fallback
Original-merge: 40e7dc9007
Merged-by: thornbill <thornbill@users.noreply.github.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
da80ba85ee
commit
39fa14a6f8
2 changed files with 8 additions and 5 deletions
|
@ -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
|
||||
});
|
||||
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue