Skip to content

Commit 195e259

Browse files
test: SNI-6952 add so_auto transformation to cldPoster
1 parent 8c2f6a8 commit 195e259

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/react/__tests__/AdvancedVideo.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('AdvancedVideo', () => {
8585
const component = mount(<AdvancedVideo cldVid={cloudinaryVideo} cldPoster="auto" />);
8686

8787
setTimeout(() => {
88-
expect(component.html()).toContain('poster="https://res.cloudinary.com/demo/video/upload/q_auto/f_jpg/sample"');
88+
expect(component.html()).toContain('poster="https://res.cloudinary.com/demo/video/upload/q_auto/f_jpg/so_auto/sample"');
8989
done();
9090
}, 0);// one tick
9191
});

packages/react/src/AdvancedVideo.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ class AdvancedVideo extends Component <VideoProps> {
118118
}
119119
})
120120
if (this.props.cldPoster === 'auto') {
121-
result['poster'] = this.props.cldVid.quality("auto").format("jpg").toURL();
121+
result['poster'] = this.props.cldVid
122+
.quality('auto')
123+
.format('jpg')
124+
.addTransformation('so_auto')
125+
.toURL()
122126
} else if (this.props.cldPoster instanceof CloudinaryImage) {
123127
result['poster'] = this.props.cldPoster.toURL();
124128
}

0 commit comments

Comments
 (0)