https://cloudinary-build-url.netlify.app/usage/transformer
This is a great package, but it doesn't appear to have support for looping gifs out of the box. The link above shows a way to create custom url sections such as "e_loop".
What I can't figure out is how to inject those properties into the URL constructor provided by the package.
previewUrl = buildVideoUrl(animation_url, {
cloud: {
cloudName: 'my-cloud'
},
transformations: {
format: 'gif',
loop: 'infinite' // Does not work
}
});
The transformer methods would seem to be the answer (see example below), but I can't figure out how to get the Transformer instance into my buildVideoUrl call. Something like:
const trans = Transformer.toString([
'c_thumb',
'w_500',
'h_500',
'g_auto',
[ 'e_grayscale' ]
])
previewUrl = buildVideoUrl(animation_url, {
cloud: {
cloudName: 'my-cloud'
},
transformations: {
format: 'gif',
trans // adding the Transformer instance
}
});
Any help is much appreciated
So to use effects you need to pass it as a key value pair. Try this
import { buildVideoUrl } from 'cloudinary-build-url'
const src = buildVideoUrl('cld_rubix', {
cloud: {
cloudName: 'demo'
},
transformations: {
format: 'gif',
effect: {
name: "loop",
}
}
});
console.log(src)
More here on how to use the different transformations: https://cloudinary-build-url.netlify.app/transformations/basic#effect