You are saying that "SambaPlayer" is not defined.
<script>
var xmlhttp = new XMLHttpRequest();
var url = "https://api.sambavideos.sambatech.com/v1/medias?access_token=847584758475847874858363&pid=3434&sort=DESC&limit=5&filter=id,title,status,qualifier,description,shortDescription,categoryName,files,thumbs";
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
myFunction(xmlhttp.responseText);
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
myFunction(url);
function myFunction(response) {
var arr = JSON.parse(JSON.stringify(response));
var i;
var out = "<div>";
for(i = 0; i < arr.length; i++) {
out += "<a href='#' class='samba-playlist-trigger list-group-item active' data-mediaid=" + arr[i].id + "></a>";
}
out += "</div>";
document.getElementById("id01").innerHTML = out;
}
</script>
<script>// <![CDATA[
var player = new SambaPlayer("player", {
height: 270,
width: 480,
playlist: playlistObj,
playerParams: {
volume: 0,
startOutput: '480p',
html5: true
},
events: {
"*": "eventListener"
}
});
// ]]></script>
<script>// <![CDATA[
function eventListener(player){
}
function onClick(mediaId, evt){
document.getElementsByClassName('samba-playlist-trigger list-group-item active')[0].className = 'samba-playlist-trigger list-group-item';
evt.target.className = "samba-playlist-trigger list-group-item active";
}
// ]]></script>
Display page html
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="container">
<div class="row">
<div id="id01"></div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script><!--chamadadosvídeos--><scripttype="text/javascript" samba-player-api="player" src="http://player.sambatech.com.br/v3/samba.player.api.js"></script>
</body>
</html>