0

I'm not familiar with js. I'd like to get the result of "file_get_contents" function and put it on the "source" (I have marked both with "https://.................).

Thank you in advance.

<script>
var myInit = {
referrer: '',
};
function file_get_contents(filename) {
fetch(filename, myInit).then((resp) => resp.text()).then(function(data) {
    content = JSON.parse(data)
    fetch(content['some']['media']['content'], myInit).then((resp) => 
resp.text()).then(function(data));});}
file_get_contents("https://.................");
</script>

<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/clappr@latest/dist/clappr.min.js"> 
</script>
</head>
<div id="player"></div>
<script>
    window.onload = function() {
        var player = new Clappr.Player({
            source: 'http://......................',
            parentId: "#player",
            height: '100%',
            width: '100%',
            autoPlay: true,
        });};
</script>
</body>
</html>
Salva RF
  • 13
  • 1
  • 4

0 Answers0