-
Notifications
You must be signed in to change notification settings - Fork 170
Description
Describe the bug
A clear and concise description of what the bug is.
Auto play not working in android 16
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
- Device: [e.g. iPhone6] : Google Pixel 9 pro
- OS + version: [e.g. iOS 13.5 | Android 10] Android 16
react-native-youtube-iframe
version 2.4.1react-native-webview
version: 13.13.5Expo
verison [if using expo]: ~53.0.12
Additional context
Add any other context about the problem here.
import React, { useCallback, useEffect, useState } from "react";
import YoutubePlayer from "react-native-youtube-iframe";
export default function TestYoutube() {
const [playing, setPlaying] = useState(true);
const onReady = useCallback(() => {
console.log("Player is ready");
setPlaying(true);
}, []);
const onChangeState = useCallback((state: string) => {
console.log("Player state:", state);
}, []);
useEffect(() => {
console.log(playing);
}, [playing]);
return (
// <View style={{ flex: 1, justifyContent: "center" }}>
<YoutubePlayer
height={250}
width="100%"
play={playing}
videoId="3yvyw2JWIVk"
forceAndroidAutoplay={true}
onReady={() => {
setPlaying(true);
}}
initialPlayerParams={{ controls: false, loop: true }}
webViewProps={{ onLoad: () => setPlaying(true) }}
onChangeState={onChangeState}
/>
//
);
}