Skip to content

Instantly share code, notes, and snippets.

@ThrivingKings
Last active May 13, 2016 15:07
Show Gist options
  • Save ThrivingKings/636bac2a59a944957da330468e33cb6e to your computer and use it in GitHub Desktop.
Save ThrivingKings/636bac2a59a944957da330468e33cb6e to your computer and use it in GitHub Desktop.
function changeImage() {
player.requestAsset({
attribute: 'image',
type: 'image'
}, function(data) {
// Ensure the property this relies on actually exists
if (data.representations) {
// First representation is the original
var image = data.representations[0];
// Update link image since new render is not triggered
linkImage.src = player.assetUrl(image.id);
// Save the uploaded image
player.setAttribute('image', image);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment