This commit is contained in:
Fredrik Burmester
2024-08-11 09:59:55 +02:00
parent 7b90389e78
commit 86dfcc6b7f
30 changed files with 24 additions and 3284 deletions

View File

@@ -1,12 +1,12 @@
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
import React, { useEffect } from "react";
import {
CastButton,
useCastDevice,
useDevices,
useRemoteMediaClient,
} from "react-native-google-cast";
import GoogleCast from "react-native-google-cast";
// import React, { useEffect } from "react";
// import {
// CastButton,
// useCastDevice,
// useDevices,
// useRemoteMediaClient,
// } from "react-native-google-cast";
// import GoogleCast from "react-native-google-cast";
type Props = {
item?: BaseItemDto | null;
@@ -14,21 +14,22 @@ type Props = {
};
export const Chromecast: React.FC<Props> = () => {
const client = useRemoteMediaClient();
const castDevice = useCastDevice();
const devices = useDevices();
const sessionManager = GoogleCast.getSessionManager();
const discoveryManager = GoogleCast.getDiscoveryManager();
// const client = useRemoteMediaClient();
// const castDevice = useCastDevice();
// const devices = useDevices();
// const sessionManager = GoogleCast.getSessionManager();
// const discoveryManager = GoogleCast.getDiscoveryManager();
useEffect(() => {
(async () => {
if (!discoveryManager) {
return;
}
// useEffect(() => {
// (async () => {
// if (!discoveryManager) {
// return;
// }
await discoveryManager.startDiscovery();
})();
}, [client, devices, castDevice, sessionManager, discoveryManager]);
// await discoveryManager.startDiscovery();
// })();
// }, [client, devices, castDevice, sessionManager, discoveryManager]);
return <CastButton style={{ tintColor: "white", height: 48, width: 48 }} />;
// return <CastButton style={{ tintColor: "white", height: 48, width: 48 }} />;
return <></>;
};