{sourceType === "hls" ? (
-
-
-
+ {isDesktopApp ? (
+ <>
+
+
+ Download this video directly to your app for offline
+ playback.
+
+
+
+ >
+ ) : (
+ <>
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+ >
+ )}
+ ) : sourceType === "file" ? (
+
+ {isDesktopApp ? (
+ <>
+
+
+ Download this video directly to your app for offline
+ playback.
+
+
+
+ >
+ ) : (
+
+ )}
+
+
) : (
<>
router.navigate("/download/pc")}>
@@ -141,7 +254,6 @@ export function DownloadView({ id }: { id: string }) {
-
diff --git a/src/hooks/useIsDesktopApp.ts b/src/hooks/useIsDesktopApp.ts
index 6245cf3d..c3b6a355 100644
--- a/src/hooks/useIsDesktopApp.ts
+++ b/src/hooks/useIsDesktopApp.ts
@@ -2,6 +2,17 @@
declare global {
interface Window {
__PSTREAM_DESKTOP__?: boolean;
+ desktopApi?: {
+ startDownload(data: {
+ url: string;
+ title: string;
+ poster?: string;
+ subtitleText?: string;
+ duration?: number;
+ type?: string;
+ }): void;
+ openOffline(): void;
+ };
}
}