feat: add cross-device playback and remote control
Continuous Integration / build_web (push) Failing after 0s
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
Continuous Integration / build_web (push) Failing after 0s
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
- native SyncPlay groups with shared queues, ready/buffering and local pause/seek reporting - follow-me prompt that transfers another session's playback to this device - auto-skip intros/recaps and skip-credits for final items - blink:// deep links with timestamped scene sharing via QR - Quick Connect approval and QR onboarding from a phone - Rust WebSocket client with Authorization header for Jellyfin 12, capabilities advertising, live sessions and remote commands
This commit is contained in:
1 parent
cb5ee9b672
commit
5746bf35a5
39 files changed
+3235
-18
No files matched your search
@@ -0,0 +1,103 @@
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Dialog,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
DialogTitle,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
import { useSnackbar } from "notistack";
|
||||
import React from "react";
|
||||
import QRCodeImage from "@/components/qrCode";
|
||||
import { handleDeepLink } from "@/utils/methods/deepLinks";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import useShareStore from "@/utils/store/share";
|
||||
|
||||
const ShareDialog = () => {
|
||||
const open = useShareStore((state) => state.open);
|
||||
const link = useShareStore((state) => state.link);
|
||||
const title = useShareStore((state) => state.title);
|
||||
const close = useShareStore((state) => state.closeShareDialog);
|
||||
const api = useApiInContext((state) => state.api);
|
||||
const user = useCentralStore((state) => state.currentUser);
|
||||
const navigate = useNavigate();
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const copy = async () => {
|
||||
await writeText(link);
|
||||
enqueueSnackbar("Link copied", { variant: "success" });
|
||||
};
|
||||
|
||||
const openHere = async () => {
|
||||
try {
|
||||
await handleDeepLink(link, { api, user, navigate });
|
||||
close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
enqueueSnackbar("Could not open the link", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={close}
|
||||
maxWidth="xs"
|
||||
fullWidth
|
||||
slotProps={{
|
||||
paper: { className: "glass", sx: { borderRadius: "22px" } },
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{title || "Share"}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
gap: 2,
|
||||
}}
|
||||
>
|
||||
<Box sx={{ p: 1, background: "#08001f", borderRadius: "14px" }}>
|
||||
<QRCodeImage value={link} />
|
||||
</Box>
|
||||
<Typography
|
||||
variant="body2"
|
||||
sx={{ opacity: 0.7, textAlign: "center" }}
|
||||
>
|
||||
Scan with Blink on a phone or TV, or copy the link to open it on
|
||||
another device.
|
||||
</Typography>
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
px: 1.5,
|
||||
py: 1,
|
||||
borderRadius: "10px",
|
||||
background: "rgba(255,255,255,0.06)",
|
||||
fontFamily: "var(--font-mono, monospace)",
|
||||
fontSize: "0.78rem",
|
||||
wordBreak: "break-all",
|
||||
userSelect: "all",
|
||||
}}
|
||||
>
|
||||
{link}
|
||||
</Box>
|
||||
</Box>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={openHere}>Open here</Button>
|
||||
<Button variant="contained" onClick={copy}>
|
||||
Copy link
|
||||
</Button>
|
||||
<Button onClick={close}>Close</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(ShareDialog);
|
||||
Reference in new issue
Block a user