mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-30 01:22:56 +01:00
fix(subtitles): rebuild track callbacks when isCurrentSubImageBased changes
The setTrack/Disable callbacks close over isCurrentSubImageBased for the transcode replacePlayer decision; add it to the track-building effect deps so they rebuild when it flips (otherwise, in a transcoding session, callbacks could stay on the MPV path after switching to/from a burned-in image sub and the player would not refresh). Addresses CodeRabbit.
This commit is contained in:
@@ -360,8 +360,10 @@ export const VideoProvider: React.FC<{ children: ReactNode }> = ({
|
||||
};
|
||||
|
||||
fetchTracks();
|
||||
// api?.basePath: the setTrack callbacks build external-sub URLs from it; rebuild
|
||||
// them once the API is ready so online externals don't resolve with undefined.
|
||||
// api?.basePath: setTrack builds external-sub URLs from it — rebuild once the
|
||||
// API is ready so online externals don't resolve with undefined.
|
||||
// isCurrentSubImageBased: setTrack closes over it for the transcode replacePlayer
|
||||
// decision — rebuild when it flips so we refresh the stream when we should.
|
||||
}, [
|
||||
tracksReady,
|
||||
mediaSource,
|
||||
@@ -369,6 +371,7 @@ export const VideoProvider: React.FC<{ children: ReactNode }> = ({
|
||||
downloadedItem,
|
||||
itemId,
|
||||
api?.basePath,
|
||||
isCurrentSubImageBased,
|
||||
]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user