feat: show upNext card for episode items in player
This commit is contained in:
8 files changed
+234
-32
No files matched your search
@@ -108,9 +108,14 @@ const PlayButton = ({
|
|||||||
case BaseItemKind.Episode:
|
case BaseItemKind.Episode:
|
||||||
result = await getTvShowsApi(api).getEpisodes({
|
result = await getTvShowsApi(api).getEpisodes({
|
||||||
seriesId: item.SeriesId,
|
seriesId: item.SeriesId,
|
||||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
fields: [
|
||||||
|
ItemFields.MediaSources,
|
||||||
|
ItemFields.MediaStreams,
|
||||||
|
ItemFields.Overview,
|
||||||
|
],
|
||||||
enableUserData: true,
|
enableUserData: true,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
|
seasonId: item.SeasonId,
|
||||||
// startItemId: item.Id,
|
// startItemId: item.Id,
|
||||||
});
|
});
|
||||||
mediaSource = await getMediaInfoApi(api).getPostedPlaybackInfo({
|
mediaSource = await getMediaInfoApi(api).getPostedPlaybackInfo({
|
||||||
@@ -142,11 +147,29 @@ const PlayButton = ({
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
introInfo = (
|
||||||
|
await axiosClient.get(
|
||||||
|
`${api.basePath}/Episode/${result.data.Items?.[0]?.Id}/IntroSkipperSegments`,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Authorization: `MediaBrowser Token=${api.accessToken}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
)?.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case BaseItemKind.Series:
|
case BaseItemKind.Series:
|
||||||
result = await getTvShowsApi(api).getEpisodes({
|
result = await getTvShowsApi(api).getEpisodes({
|
||||||
seriesId: itemId,
|
seriesId: itemId,
|
||||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
fields: [
|
||||||
|
ItemFields.MediaSources,
|
||||||
|
ItemFields.MediaStreams,
|
||||||
|
ItemFields.Overview,
|
||||||
|
],
|
||||||
enableUserData: true,
|
enableUserData: true,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
});
|
});
|
||||||
@@ -166,7 +189,7 @@ const PlayButton = ({
|
|||||||
try {
|
try {
|
||||||
introInfo = (
|
introInfo = (
|
||||||
await axiosClient.get(
|
await axiosClient.get(
|
||||||
`${api.basePath}/Episode/${result.data.Items?.[0]?.Id}/IntroTimestamps`,
|
`${api.basePath}/Episode/${result.data.Items?.[0]?.Id}/IntroSkipperSegments`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `MediaBrowser Token=${api.accessToken}`,
|
Authorization: `MediaBrowser Token=${api.accessToken}`,
|
||||||
@@ -272,7 +295,6 @@ const PlayButton = ({
|
|||||||
currentSubTrack,
|
currentSubTrack,
|
||||||
result?.mediaSource.MediaSources?.[0].MediaStreams,
|
result?.mediaSource.MediaSources?.[0].MediaStreams,
|
||||||
);
|
);
|
||||||
console.log(subtitle);
|
|
||||||
// URL generation
|
// URL generation
|
||||||
const urlOptions = {
|
const urlOptions = {
|
||||||
Static: true,
|
Static: true,
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const Carousel = ({
|
|||||||
setCurrentSlide(index);
|
setCurrentSlide(index);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{item.ImageTags?.Primary ? (
|
{item.ImageTags?.Thumb ? (
|
||||||
<img
|
<img
|
||||||
src={api.getItemImageUrl(item.Id, "Thumb", {
|
src={api.getItemImageUrl(item.Id, "Thumb", {
|
||||||
tag: item.ImageTags.Primary,
|
tag: item.ImageTags.Primary,
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
import { useApiInContext } from "@/utils/store/api";
|
||||||
|
import { playItemFromQueue, usePlaybackStore } from "@/utils/store/playback";
|
||||||
|
import useQueue from "@/utils/store/queue";
|
||||||
|
import { Button, Typography } from "@mui/material";
|
||||||
|
import React from "react";
|
||||||
|
import { getTypeIcon } from "../utils/iconsCollection";
|
||||||
|
|
||||||
|
import "./outroCard.scss";
|
||||||
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
const OutroCard = (props: { handleShowCredits: () => void }) => {
|
||||||
|
const api = useApiInContext((s) => s.api);
|
||||||
|
const [nextItemIndex, queueItems] = useQueue((s) => [
|
||||||
|
s.currentItemIndex,
|
||||||
|
s.tracks,
|
||||||
|
]);
|
||||||
|
const item = queueItems[nextItemIndex + 1];
|
||||||
|
const user = useQuery({
|
||||||
|
queryKey: ["user"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getUserApi(api).getCurrentUser();
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const handlePlayNext = useMutation({
|
||||||
|
mutationKey: ["playNextButton"],
|
||||||
|
mutationFn: () => playItemFromQueue("next", user.data?.Id, api),
|
||||||
|
onError: (error) => [console.error(error)],
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<div className="outro-card">
|
||||||
|
<Typography variant="h4">Up Next</Typography>
|
||||||
|
<div className="outro-card-content">
|
||||||
|
{item?.ImageTags?.Primary ? (
|
||||||
|
<img
|
||||||
|
className="outro-card-content-image"
|
||||||
|
alt={item.Name ?? "Cover"}
|
||||||
|
src={api.getItemImageUrl(item.Id, "Primary", {
|
||||||
|
tag: item.ImageTags.Primary,
|
||||||
|
quality: 80,
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<div className="outro-card-content-image icon">
|
||||||
|
{getTypeIcon(item?.Type)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<Typography variant="h5" className="outro-card-content-title">
|
||||||
|
{item.Name}
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle2" className="outro-card-content-overview">
|
||||||
|
{item.Overview}
|
||||||
|
</Typography>
|
||||||
|
<div className="outro-card-content-buttons">
|
||||||
|
<Button
|
||||||
|
onClick={handlePlayNext.mutate}
|
||||||
|
color="white"
|
||||||
|
variant="contained"
|
||||||
|
startIcon={
|
||||||
|
<div
|
||||||
|
className="material-symbols-rounded fill"
|
||||||
|
style={{
|
||||||
|
zIndex: 1,
|
||||||
|
fontSize: "2em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
play_arrow
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Play Now
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={props.handleShowCredits}
|
||||||
|
color="white"
|
||||||
|
variant="outlined"
|
||||||
|
>
|
||||||
|
Watch Credits
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default OutroCard;
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
.outro-card {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 0 5vw 2em 5vw;
|
||||||
|
gap: 1.2em;
|
||||||
|
background: linear-gradient(to top, rgb(10 10 10), rgb(10 10 10 / 0.7) 50%, transparent);
|
||||||
|
padding-top: 25vh;
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
display: grid;
|
||||||
|
grid-template-areas: "img title"
|
||||||
|
"img info"
|
||||||
|
"img buttons";
|
||||||
|
grid-template-columns: 20em 1fr;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1em;
|
||||||
|
|
||||||
|
&-image {
|
||||||
|
grid-area: img;
|
||||||
|
max-height: 14em;
|
||||||
|
width: 20em;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
grid-area: title;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-overview {
|
||||||
|
grid-area: info;
|
||||||
|
display: -webkit-box;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-buttons {
|
||||||
|
grid-area: buttons;
|
||||||
|
display: flex;
|
||||||
|
gap: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@ import heroBg from "@/assets/herobg.png";
|
|||||||
import "./boxset.scss";
|
import "./boxset.scss";
|
||||||
|
|
||||||
import IconLink from "@/components/iconLink";
|
import IconLink from "@/components/iconLink";
|
||||||
|
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||||
import { createFileRoute } from "@tanstack/react-router";
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import wasmUrl from "jassub/dist/jassub-worker.wasm?url";
|
|||||||
import PlayNextButton from "@/components/buttons/playNextButton";
|
import PlayNextButton from "@/components/buttons/playNextButton";
|
||||||
import PlayPreviousButton from "@/components/buttons/playPreviousButtom";
|
import PlayPreviousButton from "@/components/buttons/playPreviousButtom";
|
||||||
import QueueButton from "@/components/buttons/queueButton";
|
import QueueButton from "@/components/buttons/queueButton";
|
||||||
|
import OutroCard from "@/components/outroCard";
|
||||||
import { createFileRoute, useRouter } from "@tanstack/react-router";
|
import { createFileRoute, useRouter } from "@tanstack/react-router";
|
||||||
import type { OnProgressProps } from "react-player/base";
|
import type { OnProgressProps } from "react-player/base";
|
||||||
import subtitleFont from "./Noto-Sans-Indosphere.ttf";
|
import subtitleFont from "./Noto-Sans-Indosphere.ttf";
|
||||||
@@ -64,7 +65,7 @@ const ticksDisplay = (ticks: number) => {
|
|||||||
})}`;
|
})}`;
|
||||||
return formatedTime;
|
return formatedTime;
|
||||||
};
|
};
|
||||||
const VOLUME_SCROLL_INTERVAL = 0.05
|
const VOLUME_SCROLL_INTERVAL = 0.05;
|
||||||
|
|
||||||
export const Route = createFileRoute("/_api/player/")({
|
export const Route = createFileRoute("/_api/player/")({
|
||||||
component: VideoPlayer,
|
component: VideoPlayer,
|
||||||
@@ -116,7 +117,7 @@ function VideoPlayer() {
|
|||||||
|
|
||||||
useEffect(() => setBackdrop("", ""), []);
|
useEffect(() => setBackdrop("", ""), []);
|
||||||
|
|
||||||
const [clickTimeout, setClickTimeout] = useState<NodeJS.Timeout>(null)
|
const [clickTimeout, setClickTimeout] = useState<NodeJS.Timeout>(null);
|
||||||
|
|
||||||
const showSubtitles = useMemo(
|
const showSubtitles = useMemo(
|
||||||
() => mediaSource.subtitle.enable,
|
() => mediaSource.subtitle.enable,
|
||||||
@@ -164,7 +165,7 @@ function VideoPlayer() {
|
|||||||
PlaybackStartTimeTicks: startPosition,
|
PlaybackStartTimeTicks: startPosition,
|
||||||
PositionTicks: secToTicks(event.playedSeconds),
|
PositionTicks: secToTicks(event.playedSeconds),
|
||||||
RepeatMode: RepeatMode.RepeatNone,
|
RepeatMode: RepeatMode.RepeatNone,
|
||||||
VolumeLevel: volume * 100,
|
VolumeLevel: Math.floor(volume * 100),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -252,12 +253,12 @@ function VideoPlayer() {
|
|||||||
|
|
||||||
if (event.deltaY < 0) {
|
if (event.deltaY < 0) {
|
||||||
// increase volume
|
// increase volume
|
||||||
setVolume((state) => Math.min(1, state + VOLUME_SCROLL_INTERVAL))
|
setVolume((state) => Math.min(1, state + VOLUME_SCROLL_INTERVAL));
|
||||||
} else if (event.deltaY > 0) {
|
} else if (event.deltaY > 0) {
|
||||||
// decrease volume
|
// decrease volume
|
||||||
setVolume((state) => Math.max(0, state - VOLUME_SCROLL_INTERVAL))
|
setVolume((state) => Math.max(0, state - VOLUME_SCROLL_INTERVAL));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// attach the event listener
|
// attach the event listener
|
||||||
document.addEventListener("wheel", handleMouseWheel);
|
document.addEventListener("wheel", handleMouseWheel);
|
||||||
@@ -265,9 +266,8 @@ function VideoPlayer() {
|
|||||||
// remove the event listener
|
// remove the event listener
|
||||||
return () => {
|
return () => {
|
||||||
document.removeEventListener("wheel", handleMouseWheel);
|
document.removeEventListener("wheel", handleMouseWheel);
|
||||||
}
|
};
|
||||||
}, [])
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
setPlaying(true);
|
setPlaying(true);
|
||||||
@@ -321,17 +321,43 @@ function VideoPlayer() {
|
|||||||
|
|
||||||
const showSkipIntroButton = useMemo(() => {
|
const showSkipIntroButton = useMemo(() => {
|
||||||
if (
|
if (
|
||||||
ticksToSec(progress) >= introInfo?.ShowSkipPromptAt &&
|
ticksToSec(progress) >=
|
||||||
ticksToSec(progress) < introInfo?.HideSkipPromptAt
|
(introInfo?.Introduction?.ShowSkipPromptAt ?? 0) &&
|
||||||
|
ticksToSec(progress) < (introInfo?.Introduction?.HideSkipPromptAt ?? 0)
|
||||||
)
|
)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}, [progress]);
|
}, [progress]);
|
||||||
|
|
||||||
|
const showUpNextCard = useMemo(() => {
|
||||||
|
if (introInfo?.Credits) {
|
||||||
|
if (
|
||||||
|
ticksToSec(progress) >= introInfo?.Credits.ShowSkipPromptAt &&
|
||||||
|
ticksToSec(progress) < introInfo?.Credits.HideSkipPromptAt
|
||||||
|
)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
Math.ceil(ticksToSec(itemDuration) - ticksToSec(progress)) <= 30 &&
|
||||||
|
Math.ceil(ticksToSec(itemDuration) - ticksToSec(progress)) > 0
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}, [progress, item?.Id]);
|
||||||
|
|
||||||
const handleSkipIntro = useCallback(() => {
|
const handleSkipIntro = useCallback(() => {
|
||||||
player.current?.seekTo(introInfo?.IntroEnd);
|
player.current?.seekTo(
|
||||||
|
introInfo?.Introduction.IntroEnd ?? player.current?.getCurrentTime(),
|
||||||
|
);
|
||||||
}, [item?.Id]);
|
}, [item?.Id]);
|
||||||
|
|
||||||
|
const [forceShowCredits, setForceShowCredits] = useState(false);
|
||||||
|
const handleShowCredits = useCallback(() => {
|
||||||
|
setForceShowCredits(true);
|
||||||
|
}, []);
|
||||||
|
useEffect(() => setForceShowCredits(false), [item?.Id]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="video-player">
|
<div className="video-player">
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
@@ -374,6 +400,9 @@ function VideoPlayer() {
|
|||||||
Skip Intro
|
Skip Intro
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
{!forceShowCredits && showUpNextCard && (
|
||||||
|
<OutroCard handleShowCredits={handleShowCredits} />
|
||||||
|
)}
|
||||||
<motion.div
|
<motion.div
|
||||||
className={
|
className={
|
||||||
hoveringOsd || !playing || isSeeking
|
hoveringOsd || !playing || isSeeking
|
||||||
@@ -392,19 +421,20 @@ function VideoPlayer() {
|
|||||||
}}
|
}}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
if (event.currentTarget !== event.target) {
|
if (event.currentTarget !== event.target) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.detail === 1) {
|
if (event.detail === 1) {
|
||||||
setClickTimeout(
|
setClickTimeout(
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setPlaying((state) => !state);
|
setPlaying((state) => !state);
|
||||||
}, 200))
|
}, 200),
|
||||||
|
);
|
||||||
} else if (event.detail === 2) {
|
} else if (event.detail === 2) {
|
||||||
clearTimeout(clickTimeout)
|
clearTimeout(clickTimeout);
|
||||||
setAppFullscreen((state) => {
|
setAppFullscreen((state) => {
|
||||||
appWindow.getCurrent().setFullscreen(!state);
|
appWindow.getCurrent().setFullscreen(!state);
|
||||||
return !state
|
return !state;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -459,6 +489,7 @@ function VideoPlayer() {
|
|||||||
</TextField>
|
</TextField>
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
</div>
|
||||||
|
{(forceShowCredits || !showUpNextCard) && (
|
||||||
<div className="video-player-osd-info">
|
<div className="video-player-osd-info">
|
||||||
<Typography variant="h4" fontWeight={500} mb={2}>
|
<Typography variant="h4" fontWeight={500} mb={2}>
|
||||||
{itemName}
|
{itemName}
|
||||||
@@ -473,7 +504,7 @@ function VideoPlayer() {
|
|||||||
<Slider
|
<Slider
|
||||||
value={isSeeking ? sliderProgress : progress}
|
value={isSeeking ? sliderProgress : progress}
|
||||||
max={itemDuration}
|
max={itemDuration}
|
||||||
step={secToTicks(1)}
|
step={secToTicks(10)}
|
||||||
onChange={(e, newValue) => {
|
onChange={(e, newValue) => {
|
||||||
setIsSeeking(true);
|
setIsSeeking(true);
|
||||||
setSliderProgress(newValue);
|
setSliderProgress(newValue);
|
||||||
@@ -481,7 +512,7 @@ function VideoPlayer() {
|
|||||||
onChangeCommitted={(e, newValue) => {
|
onChangeCommitted={(e, newValue) => {
|
||||||
setIsSeeking(false);
|
setIsSeeking(false);
|
||||||
setProgress(newValue);
|
setProgress(newValue);
|
||||||
player.current.seekTo(ticksToSec(newValue), "seconds");
|
player.current?.seekTo(ticksToSec(newValue), "seconds");
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
"& .MuiSlider-thumb": {
|
"& .MuiSlider-thumb": {
|
||||||
@@ -516,7 +547,9 @@ function VideoPlayer() {
|
|||||||
<PlayPreviousButton />
|
<PlayPreviousButton />
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
player.current.seekTo(player.current.getCurrentTime() - 15)
|
player.current.seekTo(
|
||||||
|
player.current.getCurrentTime() - 15,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<span className="material-symbols-rounded fill">
|
<span className="material-symbols-rounded fill">
|
||||||
@@ -530,7 +563,9 @@ function VideoPlayer() {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
player.current.seekTo(player.current.getCurrentTime() + 15)
|
player.current.seekTo(
|
||||||
|
player.current.getCurrentTime() + 15,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<span className="material-symbols-rounded fill">
|
<span className="material-symbols-rounded fill">
|
||||||
@@ -623,8 +658,8 @@ function VideoPlayer() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
{/* <video src={hlsStream}></video> */}
|
|
||||||
<ReactPlayer
|
<ReactPlayer
|
||||||
key={item?.Id}
|
key={item?.Id}
|
||||||
playing={playing}
|
playing={playing}
|
||||||
|
|||||||
@@ -130,6 +130,9 @@ export const playItemFromQueue = async (
|
|||||||
: index === "previous"
|
: index === "previous"
|
||||||
? currentItemIndex - 1
|
? currentItemIndex - 1
|
||||||
: index;
|
: index;
|
||||||
|
const prevItem = queueItems[currentItemIndex];
|
||||||
|
const prevPlaySessionId = usePlaybackStore.getState().playsessionId;
|
||||||
|
const prevMediaSourceId = usePlaybackStore.getState().mediaSource.id;
|
||||||
const item = queueItems[requestedItemIndex];
|
const item = queueItems[requestedItemIndex];
|
||||||
if (item.Type === "Audio") {
|
if (item.Type === "Audio") {
|
||||||
const urlOptions = {
|
const urlOptions = {
|
||||||
@@ -157,7 +160,6 @@ export const playItemFromQueue = async (
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
).data;
|
).data;
|
||||||
console.log(mediaSource);
|
|
||||||
let itemName = item.Name;
|
let itemName = item.Name;
|
||||||
let episodeTitle = "";
|
let episodeTitle = "";
|
||||||
if (item.SeriesId) {
|
if (item.SeriesId) {
|
||||||
@@ -197,7 +199,7 @@ export const playItemFromQueue = async (
|
|||||||
try {
|
try {
|
||||||
introInfo = (
|
introInfo = (
|
||||||
await axiosClient.get(
|
await axiosClient.get(
|
||||||
`${api.basePath}/Episode/${item.Id}/IntroTimestamps`,
|
`${api.basePath}/Episode/${item.Id}/IntroSkipperSegments`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `MediaBrowser Token=${api.accessToken}`,
|
Authorization: `MediaBrowser Token=${api.accessToken}`,
|
||||||
@@ -213,9 +215,9 @@ export const playItemFromQueue = async (
|
|||||||
getPlaystateApi(api).reportPlaybackStopped({
|
getPlaystateApi(api).reportPlaybackStopped({
|
||||||
playbackStopInfo: {
|
playbackStopInfo: {
|
||||||
Failed: false,
|
Failed: false,
|
||||||
ItemId: item?.Id,
|
ItemId: prevItem?.Id,
|
||||||
MediaSourceId: mediaSource.MediaSources?.[0].Id,
|
MediaSourceId: prevMediaSourceId,
|
||||||
PlaySessionId: mediaSource.PlaySessionId,
|
PlaySessionId: prevPlaySessionId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
type IntroMediaInfo = {
|
type introSkipperResult = {
|
||||||
EpisodeId: string;
|
EpisodeId: string;
|
||||||
Valid: true;
|
Valid: true;
|
||||||
IntroStart: number;
|
IntroStart: number;
|
||||||
@@ -7,4 +7,9 @@ type IntroMediaInfo = {
|
|||||||
HideSkipPromptAt: number;
|
HideSkipPromptAt: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type IntroMediaInfo = {
|
||||||
|
Introduction: introSkipperResult;
|
||||||
|
Credits: introSkipperResult;
|
||||||
|
};
|
||||||
|
|
||||||
export default IntroMediaInfo
|
export default IntroMediaInfo
|
||||||
Reference in new issue
Block a user