Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// index.js
ZiggeoApi.token = "APP_TOKEN";
var init = () => {
var element = document.getElementById('recorder-embedding');
ZiggeoApi.V2.Recorder.findByElementPromise(element).success(mount);
}
var mount = (embedding) => {
embedding.on("processed", () => {
fetch("/videoTokens")
.then(res => res.json())
.then(myJson => {
const vidsToDisplay = myJson.reduce((acc, token) => {
acc += `<div class="vid-singles"><ziggeoplayer ziggeo-video="${token}" ziggeo-width=320 ziggeo-height=240 ziggeo-theme="modern" ziggeo-themecolor="red"></ziggeo></div>`;
return acc;
}, '');
const videosElement = document.getElementById('videos');
videosElement.innerHTML = vidsToDisplay;
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.