It would be awesome if we can send rawTransformations in CldVideoPlayer like we can in useCldVideoUrl!
The transformations property just appends t_ and does not do what we want.
<template>
<video
ref="videoPlayerRef"
v-if="cldVideo && isCldVideo"
:src="getVideoUrl()"
:loop="isCldVideoLoop"
autoPlay="always"
:controls="isCldVideoSound"
:quality="quality"
:muted="!isCldVideoSound"
/>
<!-- <CldVideoPlayer
ref="videoPlayerRef"
v-if="cldVideo && isCldVideo"
:src="src2"
:loop="isCldVideoLoop"
autoPlay="always"
:playsinline="true"
:controls="isCldVideoSound"
:muted="!isCldVideoSound"
:quality="quality"
:fetch-format="format"
controlsList="nodownload"
:config="{ autoplay: true }"
/> -->
</template>
<script>
export default {
props: {
//cloudinary video props
cldVideo: {
type: Object,
default: null,
},
isCldVideoQAuto: {
type: Boolean,
default: true,
},
isCldVideoFAuto: {
type: Boolean,
default: true,
},
isCldVideoSound: {
type: Boolean,
default: false,
},
isCldVideoLoop: {
type: Boolean,
default: true,
},
isCldVideoFadeEffect: {
type: Boolean,
default: false,
},
isCldVideo: {
type: Boolean,
default: false,
},
},
data() {
return {
quality: String,
format: String,
videoId: String,
};
},
created() {
//mapping width and height from selected dimensions option
if (this.isCldVideo) {
this.quality = this.isCldVideoQAuto ? 'auto' : '';
this.format = this.isCldVideoFAuto ? 'auto' : '';
this.videoId = this.cldVideo?.public_id.replace(/ /g, '%20');
}
},
methods: {
getVideoUrl() {
const { url } = useCldVideoUrl({
options: {
src: this.videoId,
quality: this.quality,
controls: this.isCldVideoSound,
autoplay: true,
controlsList: 'nodownload',
fetchFormat: this.format,
rawTransformations: this.isCldVideoFadeEffect
? 'e_fade:2000/e_fade:-2000'
: '',
},
});
return url;
},
},
};
</script>
<style>
.video-js.vjs-fluid:not(.vjs-audio-only-mode) {
min-height: 100%;
}
.cld-video-player.cld-fluid {
height: 100%;
}
.video-js .vjs-tech {
object-fit: cover;
}
</style>
It would be awesome if we can send rawTransformations in CldVideoPlayer like we can in useCldVideoUrl!
The transformations property just appends t_ and does not do what we want.
See below for how we got it to work without CldVideoPlayer: