Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
js
window.totalFramesFromVid = 100;
function widget(){
window.cloudinary.openUploadWidget({ cloud_name: 'xxxxxxx', upload_preset: '3dImage', client_allowed_formats: ['mov','mp4','webm'], sources: ['local','camera']},
function(error, result) {
if(!result)return;
//console.log(result)
window.result=result[0];
window.vidLength = window.result.duration;
window.frameGap = (window.vidLength/window.totalFramesFromVid).toFixed(2);
window.viewportWidth = $(window).width();
window.imageWidth = '';
if (viewportWidth >= 800){window.imageWidth = 800} else if (viewportWidth < 800 && viewportWidth > 500){window.imageWidth = 600} else {window.imageWidth = 320};
window.aspectRatio = window.result.width/window.result.height;
build();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment