@@ -34,7 +34,9 @@ class VideoSource extends BaseSource {
3434 options = Object . assign ( { } , DEFAULT_VIDEO_PARAMS , options ) ;
3535
3636 if ( ! options . poster ) {
37- options . poster = Object . assign ( { publicId } , DEFAULT_POSTER_PARAMS ) ;
37+ options . poster = Object . assign ( { publicId } , DEFAULT_POSTER_PARAMS , {
38+ resource_type : options . resourceType || 'video'
39+ } ) ;
3840 }
3941
4042 super ( publicId , options ) ;
@@ -67,18 +69,18 @@ class VideoSource extends BaseSource {
6769 this [ prop ] ( options [ prop ] ) ;
6870 }
6971 } ) ;
70-
72+
7173 // Initialize poster
7274 this . poster ( options . poster ) ;
73-
75+
7476 this . objectId = generateId ( ) ;
7577 }
7678
7779 // Helper method to create simple getter/setter methods
7880 _createGetterSetters ( properties ) {
7981 properties . forEach ( prop => {
8082 const privateKey = `_${ prop } ` ;
81- this [ prop ] = function ( value ) {
83+ this [ prop ] = function ( value ) {
8284 if ( value === undefined ) {
8385 // Provide sensible defaults for specific properties
8486 if ( prop === 'sourceTypes' && this [ privateKey ] === undefined ) {
@@ -119,7 +121,9 @@ class VideoSource extends BaseSource {
119121
120122 if ( ! publicId ) {
121123 publicId = this . publicId ( ) ;
122- options = Object . assign ( { } , options , DEFAULT_POSTER_PARAMS ) ;
124+ options = Object . assign ( { } , options , DEFAULT_POSTER_PARAMS , {
125+ resource_type : this . resourceType ( ) || 'video'
126+ } ) ;
123127 }
124128
125129 options . cloudinaryConfig = options . cloudinaryConfig || this . cloudinaryConfig ( ) ;
@@ -149,7 +153,10 @@ class VideoSource extends BaseSource {
149153 opts . transformation = castArray ( srcTransformation ) ;
150154 }
151155
152- Object . assign ( opts , { resource_type : 'video' , format } ) ;
156+ Object . assign ( opts , {
157+ resource_type : this . resourceType ( ) || 'video' ,
158+ format
159+ } ) ;
153160
154161 const [ type , codecTrans ] = formatToMimeTypeAndTransformation ( sourceType ) ;
155162
@@ -214,7 +221,7 @@ class VideoSource extends BaseSource {
214221 }
215222
216223 const info = this . _info || this . getInitOptions ( ) . info ;
217-
224+
218225 return {
219226 title : this . title ( ) || info ?. title || '' ,
220227 subtitle : this . description ( ) || info ?. subtitle || '' ,
0 commit comments