-
Notifications
You must be signed in to change notification settings - Fork 169
Open
Description
Describe the bug
Pressing on fullscreen button forces re-rendering
WhatsApp.Video.2024-10-19.at.13.13.31.mp4
How can i solve this issue, it only happens on android,
Here is the code:
import React, { useState } from 'react';
import { View } from 'react-native';
import YoutubePlayer from 'react-native-youtube-iframe';
interface YoutubePlayerProps {
mediaUrl: string;
}
const YoutubePlayerComponent: React.FC<YoutubePlayerProps> = ({ mediaUrl }) => {
const getVideoId = (url: string): string => {
const videoIdMatch = url.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);
return videoIdMatch ? videoIdMatch[1] : '';
};
return (
<View>
<YoutubePlayer
height={350}
videoId={getVideoId(mediaUrl)}
onError={(e) => console.error('Error loading video', e)}
/>
</View>
);
};
anthlasserre
Metadata
Metadata
Assignees
Labels
No labels