Skip to content

Commit fcbc593

Browse files
feat: SNI-6952 clone original video before creating auto poster
1 parent cdb8fe4 commit fcbc593

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/html/src/layers/htmlVideoLayer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Plugins, HtmlPluginState, VideoSources, VideoType, VideoPoster} from '../types.js'
22
import cloneDeep from 'lodash.clonedeep'
3-
import {CloudinaryImage, CloudinaryVideo} from "@cloudinary/url-gen";
3+
import {CloudinaryVideo} from "@cloudinary/url-gen";
44
import {render} from '../utils/render.js';
55
import {VIDEO_MIME_TYPES} from "../utils/internalConstants.js";
66

@@ -106,7 +106,8 @@ export class HtmlVideoLayer{
106106
*/
107107
setVideoAttributes(videoAttributes: object = {}, userCloudinaryPoster?: VideoPoster) {
108108
if (userCloudinaryPoster === 'auto') {
109-
videoAttributes['poster'] = this.originalVideo
109+
const posterCloudinaryVideo = cloneDeep(this.originalVideo);
110+
videoAttributes['poster'] = posterCloudinaryVideo
110111
.quality('auto')
111112
.format('jpg')
112113
.addTransformation('so_auto')

0 commit comments

Comments
 (0)