Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onChangeState with Flatlist is not working #334

Open
vishaledkey opened this issue Apr 18, 2024 · 2 comments
Open

onChangeState with Flatlist is not working #334

vishaledkey opened this issue Apr 18, 2024 · 2 comments

Comments

@vishaledkey
Copy link

Hi, I'm using the YouTubePlayer inside a FlatList. I want to use the onChangeState and onReady functions, but these functions don't seem to be working. When I try to use YouTubePlayer outside the FlatList (standalone instance), it works fine and both the mentioned functions work fine.

code:

const renderListItem = ({ item, index }) => {
        return (
            <View key={item.videoId}>
                <View style={styles.listItemContainer} >
                    <View>
                        
                             <YoutubePlayer
                                height={240}
                                play={false}
                                videoId={item.videoId}
                                onReady={() => {console.log("Vishal:: youtube ready")}}
                                onChangeState={(event) => {console.log("Vishal:: youtube event", event)}}
                            />
                        <Text style={styles.itemDuration} numberOfLines={1}> {item.lengthText}</Text>
                    </View>
                    //rest of the code
                </View>
            </View>
        );
    };

Library version: "react-native-youtube-iframe": "^2.3.0"

@Roamer77
Copy link

Roamer77 commented May 7, 2024

same

@sraut1
Copy link

sraut1 commented May 15, 2024

Same issue, were you able to find any solution to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants