fix(player): unable to play media without subtitles
This commit is contained in:
3 files changed
+8
-3
No files matched your search
@@ -234,8 +234,11 @@ const PlayButton = ({
|
|||||||
const subtitles = result?.Items[0].MediaSources[0].MediaStreams?.filter(
|
const subtitles = result?.Items[0].MediaSources[0].MediaStreams?.filter(
|
||||||
(value) => value.Type === "Subtitle",
|
(value) => value.Type === "Subtitle",
|
||||||
);
|
);
|
||||||
if (!currentSubTrack) {
|
let enableSubtitles = true;
|
||||||
|
if (!currentSubTrack && subtitles?.length > 0) {
|
||||||
selectedSubtitleTrack = subtitles[0].Index;
|
selectedSubtitleTrack = subtitles[0].Index;
|
||||||
|
} else {
|
||||||
|
enableSubtitles = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
playItem(
|
playItem(
|
||||||
@@ -245,7 +248,7 @@ const PlayButton = ({
|
|||||||
currentAudioTrack,
|
currentAudioTrack,
|
||||||
selectedSubtitleTrack,
|
selectedSubtitleTrack,
|
||||||
result.Items[0].Container,
|
result.Items[0].Container,
|
||||||
true,
|
enableSubtitles,
|
||||||
`${api.basePath}/Videos/${result.Items[0].Id}/stream.${result.Items[0].Container}?Static=true&mediaSourceId=${result.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${result.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
`${api.basePath}/Videos/${result.Items[0].Id}/stream.${result.Items[0].Container}?Static=true&mediaSourceId=${result.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${result.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
||||||
userId,
|
userId,
|
||||||
result?.Items[0].UserData?.PlaybackPositionTicks,
|
result?.Items[0].UserData?.PlaybackPositionTicks,
|
||||||
@@ -254,7 +257,7 @@ const PlayButton = ({
|
|||||||
queue,
|
queue,
|
||||||
0,
|
0,
|
||||||
subtitles,
|
subtitles,
|
||||||
result?.Items[0].MediaSources[0].Id
|
result?.Items[0].MediaSources[0].Id,
|
||||||
);
|
);
|
||||||
navigate("/player");
|
navigate("/player");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ $cardWidth: 22%;
|
|||||||
&-cast {
|
&-cast {
|
||||||
max-height: 50vh;
|
max-height: 50vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
mask-image: linear-gradient(to top, transparent, black 1.2em);
|
mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||||
-webkit-mask-image: linear-gradient(to top, transparent, black 1.2em);
|
-webkit-mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||||
&-title {
|
&-title {
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ $cardWidth: 18%;
|
|||||||
&-cast {
|
&-cast {
|
||||||
max-height: 50vh;
|
max-height: 50vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
mask-image: linear-gradient(to top, transparent, black 1.2em);
|
mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||||
-webkit-mask-image: linear-gradient(to top, transparent, black 1.2em);
|
-webkit-mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||||
&-title {
|
&-title {
|
||||||
|
|||||||
Reference in new issue
Block a user