Skip to content

Instantly share code, notes, and snippets.

@el3um4s
Created August 27, 2022 15:48
Show Gist options
  • Save el3um4s/2e906ff421979b3c29ac9074bc99a7e5 to your computer and use it in GitHub Desktop.
Save el3um4s/2e906ff421979b3c29ac9074bc99a7e5 to your computer and use it in GitHub Desktop.
MEDIUM - How To Create a Simple YouTube Player With JavaScript - 03
import * as YouTube from "./youTube.js";
export async function createVideo(iframeId) {
Globals.ytPlayer[iframeId]["player"] = await YouTube.CreatePlayer(iframeId, {
onStateChange: (e) => {
console.log(e.data);
},
onReady: (e) => {
console.log(e);
},
});
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment