Hello,
I am trying to embed clips on my website following the clips discovery guide (https://dev.twitch.tv/docs/v5/guides/clips-discovery)
I keep getting the following error:
[NoParent] parent query string value was not specified
Here is my code:
<html>
<head>
<title>Clips Carousel</title>
</head>
<body>
<div id="clips-display">
</div>
<script>
var httpRequest = new XMLHttpRequest();
httpRequest.addEventListener('load', clipsLoaded);
httpRequest.open('GET', 'https://api.twitch.tv/kraken/clips/top?limit=10&game=Overwatch&trending=true');
httpRequest.setRequestHeader('Client-ID', 'MY-CLIENT-ID');
httpRequest.setRequestHeader('Accept', 'application/vnd.twitchtv.v5+json');
httpRequest.send();
function clipsLoaded() {
var clipsDisplay = document.getElementById('clips-display'),
clipList = JSON.parse(httpRequest.responseText);
clipList.clips.forEach(function(clip, index, array) {
clipItem = document.createElement('div');
clipItem.innerHTML = clip.embed_html;
clipsDisplay.appendChild(clipItem);
});
}
</script>
</body>
</html>
I’m really struggling with this and any guidance in the right direction would be greatly appreciated.