var videoOpts = { sources: [ { src: '../media/lego.mp4', type: 'video/mp4' }, { src: '../media/lego.webm', type: 'video/webm' } ], attributes: { resize: true, center: true } }, videos = videoOpts.d = videoOpts, opts; opts = (videoOpts); videoOpts.d = videoOpts = { maxWidth: 600, upscale: true }; opts.attributes.id = 'video-one-vjs'; for (var i = 0, ii = videos.length; i < ii; i++) { opts = JSON.parse(JSON.stringify(videoOpts)); opts.attributes.id = videos[i] + '-vjs'; }