Continuous Integration / build_web (push) Failing after 1s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
- translate the interface into Russian - add picture-in-picture and video fit modes - derive skip segments from Jellyfin chapter markers - align player navigation and add a window drag region - keep audio playback alive across routes
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
|
import IconButton from "@mui/material/IconButton";
|
|
import Tooltip from "@mui/material/Tooltip";
|
|
import React from "react";
|
|
import useRemoteControlStore, {
|
|
type RemoteTransfer,
|
|
} from "@/utils/store/remoteControl";
|
|
|
|
type CastButtonProps = {
|
|
item?: BaseItemDto | null;
|
|
transfer?: Omit<RemoteTransfer, "item">;
|
|
/** Computed on click so playback position/queue are current. */
|
|
getTransfer?: () => Omit<RemoteTransfer, "item">;
|
|
size?: "small" | "medium" | "large";
|
|
};
|
|
|
|
const CastButton = ({
|
|
item,
|
|
transfer,
|
|
getTransfer,
|
|
size = "medium",
|
|
}: CastButtonProps) => {
|
|
const openDialog = useRemoteControlStore((s) => s.openDialog);
|
|
return (
|
|
<Tooltip title={item ? "Воспроизвести на другом устройстве" : "Удалённое управление"}>
|
|
<IconButton
|
|
size={size}
|
|
aria-label={item ? "Воспроизвести на другом устройстве" : "Удалённое управление"}
|
|
onClick={() =>
|
|
openDialog({
|
|
...(getTransfer ? getTransfer() : transfer),
|
|
item: item ?? null,
|
|
})
|
|
}
|
|
>
|
|
<span className="material-symbols-rounded">cast</span>
|
|
</IconButton>
|
|
</Tooltip>
|
|
);
|
|
};
|
|
|
|
export default CastButton;
|