Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

548
Views
Cómo incrustar un canal de Twitch (video + chat) usando React Js

Hola, estoy creando una aplicación web para mí y tratando de usar la API integrada de Twitch para mostrar las transmisiones de Twitch y el chat dentro de mi página web. No estoy seguro de cómo manejar esto. Tengo algo de experiencia con React JS, pero definitivamente no con esto.

Proporcionan un HTML pero no tengo idea de cómo hacer que funcione en mi aplicación:

 <html> <body> <!-- Add a placeholder for the Twitch embed --> <div id="twitch-embed"></div> <!-- Load the Twitch embed JavaScript file --> <script src="https://embed.twitch.tv/embed/v1.js"></script> <!-- Create a Twitch.Embed object that will render within the "twitch-embed" element --> <script type="text/javascript"> new Twitch.Embed("twitch-embed", { width: 854, height: 480, channel: "monstercat", // Only needed if this page is going to be embedded on other websites parent: ["embed.example.com", "othersite.example.com"] }); </script> </body> </html>

Como no entendí esto, intenté obtener el video al menos, este es el código que proporcionan, pero no lo he logrado para que funcione hasta ahora:

 <iframe src="https://player.twitch.tv/?<channel, video, or collection>&parent=streamernews.example.com" height="<height>" width="<width>" allowfullscreen="<allowfullscreen>"> </iframe>

Hice lo siguiente y obtuve este resultado:

 <Box mb={3} sx={{display: 'flex', justifyContent: 'center', mr: 2}}> <CardMedia component = "iframe" src="https://player.twitch.tv/?<StreamerName>&parent=localhost" title = 'Faker stream' controls/> </Box>

ingrese la descripción de la imagen aquí

O esto

ingrese la descripción de la imagen aquí

Este es elSandBox que he creado. Vi otros recursos/preguntas/respuestas y están un poco desactualizados, por eso creé esta nueva pregunta.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si alguien se preguntaba cómo hacer esto, obtuve el video que funciona. Lo actualizaré nuevamente si obtengo el HTML con chat + video funcionando.

SOLO VÍDEO

 <Box mb={3} sx={{display: 'flex', justifyContent: 'center', mr: 2, color: "white"}}> <CardMedia component = "iframe" src="https://player.twitch.tv/?channel=faker&parent=localhost" height = "800" title = 'Faker stream' controls/> </Box>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!