react-native-google-cast
Version:
React Native wrapper for the Google Cast SDK for iOS and Android
24 lines (23 loc) • 625 B
JavaScript
import useCastSession from './useCastSession';
/**
* Hook that provides the current {@link RemoteMediaClient}.
*
* @returns current client, or `null` if there's no session connected
* @example
* ```js
* import { useRemoteMediaClient } from 'react-native-google-cast'
*
* function MyComponent() {
* const client = useRemoteMediaClient()
*
* if (client) {
* client.loadMedia(...)
* }
* }
* ```
*/
export default function useRemoteMediaClient(options) {
const castSession = useCastSession(options);
return castSession ? castSession.client : null;
}
//# sourceMappingURL=useRemoteMediaClient.js.map