Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

353
Vistas
How to pass stream from php link to clappr player?

I have a php link that return the url of stream like this: https://myexample.com/test.php?id=xyz

<?php
//declare some headers and variables
$_GET["id"];
//Do some curl here
$stream = $result;
echo $stream; //http://myexample.com/xyz.m3u8?token=xxx
?>

I would to pass the result of the php link to the my video page that contain clappr player. How do I define the variable src to get the stream link from the php response in the script? I did this way but not working.

<div id="player">
</div>
<script>
    var src="https://myexample.com/test.php?id=xyz";
    var player = new Clappr.Player({source: src, 
    autoPlay: true,
    height: 360,
    width: '100%',
    parentId: "#player"
});
  </script>

Please help!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This will work only if javascript is placed in the same file:

<?php $stream = "http://myexample.com/xyz.m3u8?token=xxx"; ?>
var src="<?php echo $stream; ?>";
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda