import Banner from 'componentes/Banner';
import styles from './Player.module.css';
import videos from '../../pages/Inicio/Json/db.json';
import Titulo from 'componentes/Titulo';
import { useParams } from 'react-router-dom';
import Rodape from 'componentes/rodape';
export default function Player(){
const parametros = useParams();
const video = videos.find((video) => {
return video.id === Number(parametros.id);
})
return(
<>
<div className={styles.centro}>
<h1>Player</h1>
</div>
<section className={styles.container}>
<iframe className={styles.container_video} width="100%"
height="100%"
src={video.link}
title={video.titulo}
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</section>
</>
)
}
Arquivo DB.JSON
[
{
"id": 1,
"titulo": "Sombra",
"capa": "./imagens/card1.png",
"link": "https://youtu.be/Og5-Pm4HNlI"
},
{
"id": 2,
"titulo": "Reaper",
"capa": "./imagens/card2.png",
"link": "https://youtu.be/nFP65i141to"
},
{
"id": 3,
"titulo": "Junkrat",
"capa": "./imagens/card3.png",
"link": "https://youtu.be/DqhiLbRXGUQ"
},
{
"id": 4,
"titulo": "Winston",
"capa": "./imagens/card4.png",
"link": "https://youtu.be/pwFu8kEsUW4"
}
]