mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-02 02:22:51 +01:00
feat: adding exoplayer for HDR playback
Currently MPV doesn't support HDR via external displays. giving people the choice of HDR/limited ass sub support/SDR full sub support Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com>
This commit is contained in:
@@ -171,11 +171,38 @@ export type HomeSectionLatestResolver = {
|
||||
includeItemTypes?: Array<BaseItemKind>;
|
||||
};
|
||||
|
||||
// Video player enum - currently only MPV is supported
|
||||
// Video player enum. MPV is the universal default; ExoPlayer is an
|
||||
// opt-in alternative on Android TV, selectable via settings.videoPlayer.
|
||||
export enum VideoPlayer {
|
||||
MPV = 0,
|
||||
ExoPlayer = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the actually-active video player for the current settings.
|
||||
* MPV is the default on every platform; users can opt into ExoPlayer on
|
||||
* Android TV via settings.videoPlayer. Centralized here so the rule has
|
||||
* one source of truth (used by VideoPlayerView, direct-player's device
|
||||
* profile, and the TV settings UI).
|
||||
*/
|
||||
export const getActiveVideoPlayer = (
|
||||
settings: Pick<Settings, "videoPlayer"> | null | undefined,
|
||||
): VideoPlayer => {
|
||||
return settings?.videoPlayer ?? VideoPlayer.MPV;
|
||||
};
|
||||
|
||||
/**
|
||||
* Same selection as getActiveVideoPlayer but returns the lowercase
|
||||
* player-type identifier that `generateDeviceProfile` expects.
|
||||
*/
|
||||
export const getActivePlayerType = (
|
||||
settings: Pick<Settings, "videoPlayer"> | null | undefined,
|
||||
): "mpv" | "exoplayer" => {
|
||||
return getActiveVideoPlayer(settings) === VideoPlayer.ExoPlayer
|
||||
? "exoplayer"
|
||||
: "mpv";
|
||||
};
|
||||
|
||||
// TV Typography scale presets
|
||||
export enum TVTypographyScale {
|
||||
Small = "small",
|
||||
@@ -218,6 +245,8 @@ export type Settings = {
|
||||
mediaListCollectionIds?: string[];
|
||||
preferedLanguage?: string;
|
||||
searchEngine: "Marlin" | "Jellyfin" | "Streamystats";
|
||||
/** Video player backend. Defaults to MPV when unset (see getActiveVideoPlayer). */
|
||||
videoPlayer?: VideoPlayer;
|
||||
marlinServerUrl?: string;
|
||||
streamyStatsServerUrl?: string;
|
||||
streamyStatsMovieRecommendations?: boolean;
|
||||
@@ -315,6 +344,8 @@ export const defaultValues: Settings = {
|
||||
mediaListCollectionIds: [],
|
||||
preferedLanguage: undefined,
|
||||
searchEngine: "Jellyfin",
|
||||
// videoPlayer intentionally undefined — resolved at runtime via
|
||||
// getActiveVideoPlayer() so existing installs are unaffected.
|
||||
marlinServerUrl: "",
|
||||
streamyStatsServerUrl: "",
|
||||
streamyStatsMovieRecommendations: false,
|
||||
|
||||
Reference in New Issue
Block a user