mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 13:46:59 +00:00
feat(android): support chromecast
This commit is contained in:
@@ -69,6 +69,7 @@ function PlayerExample({
|
||||
const muted = usePlayerState("muted");
|
||||
const volume = usePlayerState("volume");
|
||||
const isAutoQuality = usePlayerState("isAutoQuality");
|
||||
const castStatus = usePlayerState("castStatus");
|
||||
const [logs, setLogs] = useState<string[]>([]);
|
||||
const [tracks, setTracks] = useState(() => ({
|
||||
videos: [...player.videos],
|
||||
@@ -265,6 +266,21 @@ function PlayerExample({
|
||||
</Pressable>
|
||||
</View>
|
||||
|
||||
<View style={styles.row}>
|
||||
<Pressable
|
||||
style={styles.button}
|
||||
disabled={castStatus === "unsupported"}
|
||||
onPress={() => player.toggleCastStatus()}
|
||||
>
|
||||
<Text style={styles.buttonText}>
|
||||
{castStatus === "connected" || castStatus === "connecting"
|
||||
? "Stop cast"
|
||||
: "Cast"}
|
||||
</Text>
|
||||
</Pressable>
|
||||
<Text style={styles.buttonText}>Cast: {castStatus}</Text>
|
||||
</View>
|
||||
|
||||
<View style={styles.statsCard}>
|
||||
<Text style={styles.statText}>Status: {status}</Text>
|
||||
<Text style={styles.statText}>
|
||||
|
||||
Reference in New Issue
Block a user