Skip to content

Instantly share code, notes, and snippets.

@ethanstenis ethanstenis/herbalife.js
Last active Dec 7, 2016

Embed
What would you like to do?
$.getJSON("http://freegeoip.net/json/", function(data) {
// We need to evaluate the services for getting JSON - what should happen if this service goes down. We may need to code for that back-up.
var country = data.country_name;
var ip = data.ip;
// alert("country " + country);
// alert("IP " + ip);
var invodoVideoId = "";
Invodo.init({
pageName: "Herbalife Pill Bottle - 3D Spin",
pageType: "product",
onload: function() {
if (country === "United States - English") {
var invodoVideoId === "Bottle_US_Eng";
} else if (country === "United States - Espanol") {
var invodoVideoId === "Bottle_US_Esp";
} else if (...) {
...
} else {
var invodoVideoId = "Bottle_Default";
}
}
})
var args = {
refId: invodoVideoId,
name: '3d-spin',
// The following params are stored in the customData field of the
// above refId, but you can uncomment them below to override.
// envmap: '../../dist/viewer/envs/...', // specify the environment to use
// model: '../../test/direct/...',
// // model: '../../dist/viewer/models/alcatelidol3-callout.invodo', // specify the model to use,
// placeholder: '../../dist/viewer/models/...jpg', // placeholder image
// resourcePath: '../../dist/viewer/res', // specify the resource folder
// container: '#container',
// notSupported: function(){ // catch no webgl support and handle it
// $('<div class="error">WebGL is not supported.</div>')
// .appendTo('#container');
// }
// dataPath: 'scripts/data.json'
};
// var viewer = new Invodo.Ixd.WebGLViewer(args, function(viewer) {
// viewer.events.on('playerReady', function(e) {
// console.log('player ready!');
// console.log(e);
// });
//
// viewer.events.on('zoom.start', function(e) {
// console.log('zoom started, level = ' + e.zoomLevel);
// });
//
// viewer.events.on('zoom.stop', function(e) {
// console.log('zoom stopped, level = ' + e.zoomLevel);
// });
//
// viewer.events.on('spin.start', function(e) {
// console.log('spin started');
// });
//
// viewer.events.on('spin.stop', function(e) {
// console.log('spin stopped');
// });
//
// viewer.events.on('hotspot.click', function(e) {
// console.log(e);
// });
//
// viewer.events.on('control.click', function(e) {
// console.log(e.controlName + ' clicked!');
// });
// });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.