mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-28 19:36:29 +01:00
refactor(casting): remove AirPlay references, keep extensible architecture
- Remove AirPlay from CastProtocol type union (Chromecast only for now) - Replace AirPlay TODOs with generic 'Future: Add X for other protocols' comments - Remove PROTOCOL_COLORS export, use hardcoded Chromecast color (#F9AB00) - Update all component headers to be protocol-agnostic - Keep switch statements extensible for future protocol additions - Maintain clean architecture for easy integration of new casting protocols Architecture remains flexible for future protocols (AirPlay, DLNA, etc.)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Unified Casting Helper Functions
|
||||
* Common utilities for both Chromecast and AirPlay
|
||||
* Common utilities for casting protocols
|
||||
*/
|
||||
|
||||
import type { CastProtocol, ConnectionQuality } from "./types";
|
||||
@@ -110,8 +110,7 @@ export const getProtocolName = (protocol: CastProtocol): string => {
|
||||
switch (protocol) {
|
||||
case "chromecast":
|
||||
return "Chromecast";
|
||||
case "airplay":
|
||||
return "AirPlay";
|
||||
// Future: Add cases for other protocols
|
||||
}
|
||||
};
|
||||
|
||||
@@ -124,8 +123,7 @@ export const getProtocolIcon = (
|
||||
switch (protocol) {
|
||||
case "chromecast":
|
||||
return "tv";
|
||||
case "airplay":
|
||||
return "logo-apple";
|
||||
// Future: Add icons for other protocols
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/**
|
||||
* Unified Casting Types and Options
|
||||
* Abstracts Chromecast and AirPlay into a common interface
|
||||
* Protocol-agnostic casting interface - currently supports Chromecast
|
||||
* Architecture allows for future protocols (AirPlay, DLNA, etc.)
|
||||
*/
|
||||
|
||||
export type CastProtocol = "chromecast" | "airplay";
|
||||
export type CastProtocol = "chromecast";
|
||||
|
||||
export interface CastDevice {
|
||||
id: string;
|
||||
@@ -79,9 +80,3 @@ export const DEFAULT_CAST_STATE: CastPlayerState = {
|
||||
};
|
||||
|
||||
export type ConnectionQuality = "excellent" | "good" | "fair" | "poor";
|
||||
|
||||
// Protocol-specific colors for UI differentiation
|
||||
export const PROTOCOL_COLORS = {
|
||||
chromecast: "#e50914", // Red (Google Cast)
|
||||
airplay: "#007AFF", // Blue (Apple)
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user