Skip to content

Instantly share code, notes, and snippets.

@Maharony
Created April 27, 2018 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Maharony/4ffe6a1551b9093c94a01d4de8ad2805 to your computer and use it in GitHub Desktop.
Save Maharony/4ffe6a1551b9093c94a01d4de8ad2805 to your computer and use it in GitHub Desktop.
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