File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ export default {
1919 textTrackSettings : false ,
2020 loop : false ,
2121 muted : false ,
22- poster : true ,
2322 posterOptions : { } ,
2423 sourceTypes : [ 'auto' ] ,
2524 contextMenu : {
Original file line number Diff line number Diff line change 66 normalizeOptions ,
77 mergeTransformations ,
88 extendCloudinaryConfig ,
9- setupCloudinaryMiddleware
9+ setupCloudinaryMiddleware ,
10+ isRawUrl
1011} from './common' ;
1112import VideoSource from './models/video-source/video-source' ;
1213import EventHandlerRegistry from './event-handler-registry' ;
@@ -127,12 +128,21 @@ class CloudinaryContext {
127128
128129 const defaultPosterOptions = posterOptionsForCurrent ( ) ;
129130 const userPosterOptions = options . posterOptions ;
130- options . poster = options . poster || defaultPosterOptions ;
131+ const hasUserPosterOptions = userPosterOptions && Object . keys ( userPosterOptions ) . length > 0 ;
132+
133+ if ( options . poster === undefined ) {
134+ if ( isRawUrl ( publicId ) ) {
135+ options . poster = false ;
136+ } else if ( ! hasUserPosterOptions ) {
137+ options . poster = true ;
138+ }
139+ }
140+
131141 options . posterOptions = Object . assign (
132142 { } ,
133143 defaultPosterOptions ,
134144 userPosterOptions ,
135- { hasUserPosterOptions : ! ! userPosterOptions || null }
145+ { hasUserPosterOptions : hasUserPosterOptions || null }
136146 ) ;
137147
138148 options . queryParams = Object . assign ( options . queryParams || { } , options . allowUsageReport ? { _s : `vp-${ VERSION } ` } : { } ) ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class VideoSource extends BaseSource {
3939 options . resource_type = options . resourceType ;
4040 }
4141
42- if ( ! options . poster ) {
42+ if ( options . poster === undefined ) {
4343 options . poster = Object . assign ( { publicId } , DEFAULT_POSTER_PARAMS ) ;
4444 }
4545
You can’t perform that action at this time.
0 commit comments