/**
 * External video player catalog.
 *
 * We ship ONLY two supported external apps: ExoPlayer (Just Player) and VLC.
 * The app auto-picks whichever is installed — no user choice.
 */

export interface ExternalApp {
  id: "exoplayer" | "vlc";
  label: string;
  androidPackage: string;
  playStoreUrl: string;
  iosScheme?: string;
  hint?: string;
}

export const EXTERNAL_APPS: ExternalApp[] = [
  {
    id: "exoplayer",
    label: "Just Player (ExoPlayer)",
    androidPackage: "com.brouken.player",
    playStoreUrl:
      "https://play.google.com/store/apps/details?id=com.brouken.player",
    hint: "ExoPlayer-powered · best for IPTV & HLS",
  },
  {
    id: "vlc",
    label: "VLC Media Player",
    androidPackage: "org.videolan.vlc",
    playStoreUrl:
      "https://play.google.com/store/apps/details?id=org.videolan.vlc",
    iosScheme: "vlc-x-callback",
    hint: "Universal player — all codecs",
  },
];

const DEFAULT_ID: ExternalApp["id"] = "exoplayer";

export const getExternalAppId = (): string => DEFAULT_ID;

export const getExternalApp = (): ExternalApp => EXTERNAL_APPS[0];

export const setExternalAppId = (_id: string): void => {
  /* no-op — preference removed, app auto-picks ExoPlayer → VLC */
};
