Created
February 12, 2015 23:52
-
-
Save skevy/f8f73076a5316f4bffa2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
window.parent.video_checkout_9as8dfasdf.openCheckoutModal(window.videoId) | |
} | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment