Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var VideoCheckout = function() {
VideoCheckout.prototype.init(videoId, {container, modalContainer, width, height}) {
if(!modalContainer) {
modalContainer = document.body
VideoCheckout.prototype.openCheckoutModal(videoId) {
// we need to create a modal on the parent page, put an iframe in it,
// and point the iframe to the video with a querystring of "checkoutModal".
// We can then handle that query string in the embed code (in "scripts/embed/EmbedContainer")
// and instead of showing the video, we can JUST show the checkout modal.
var video_checkout_9as8dfasdf = new VideoCheckout("videoId", {
"container": document.querySelectorAll(".my-checkout-container")
"width": 720,
"height": 480
In the actual video checkout code, in the action
showCheckoutWizard() {
if(window.innerWidth < 800 && window.parent) {
//we need to show the checkout outside of the window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment