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

346
Views
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 answers
Answer question

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 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!