mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-20 22:06:35 +01:00
18 lines
428 B
TypeScript
18 lines
428 B
TypeScript
import type { HWEvent } from "react-native";
|
|
import { Platform } from "react-native";
|
|
|
|
type UseTVEventHandler = (callback: (evt: HWEvent) => void) => void;
|
|
|
|
let tvEventHandler: UseTVEventHandler = () => {};
|
|
|
|
if (Platform.isTV) {
|
|
try {
|
|
tvEventHandler = require("react-native")
|
|
.useTVEventHandler as UseTVEventHandler;
|
|
} catch {
|
|
tvEventHandler = () => {};
|
|
}
|
|
}
|
|
|
|
export const useTVEventHandler = tvEventHandler;
|