diff --git a/src/plugins/cloudinary/index.js b/src/plugins/cloudinary/index.js index 635db8f3..ccc97fd9 100644 --- a/src/plugins/cloudinary/index.js +++ b/src/plugins/cloudinary/index.js @@ -255,9 +255,10 @@ class CloudinaryContext { const refresh = () => { const src = this.source(); - const { posterColor } = this.player.cloudinary.posterOptions(); - if (posterColor) { - this.disablePoster(posterColor); + const posterOptions = Object.assign({}, this.player.cloudinary.posterOptions(), src.getInitOptions().poster); + + if (posterOptions.posterColor) { + this.disablePoster(posterOptions.posterColor); } else if (src.poster()) { this.player.poster(src.poster().url()); } @@ -298,14 +299,13 @@ class CloudinaryContext { const posterOptionsForCurrent = () => { const opts = assign({}, this.posterOptions()); - if (opts.transformation) { - if ((opts.transformation.width || opts.transformation.height) && !opts.transformation.crop) { - opts.transformation.crop = 'scale'; - } - } opts.transformation = opts.transformation || {}; + if ((opts.transformation.width || opts.transformation.height) && !opts.transformation.crop) { + opts.transformation.crop = 'scale'; + } + // Set poster dimensions to player actual size. // (unless they were explicitly set via `posterOptions`) const playerEl = this.player.el(); diff --git a/src/plugins/cloudinary/models/video-source/video-source.js b/src/plugins/cloudinary/models/video-source/video-source.js index 9c76a07a..7e7f2b62 100644 --- a/src/plugins/cloudinary/models/video-source/video-source.js +++ b/src/plugins/cloudinary/models/video-source/video-source.js @@ -169,6 +169,10 @@ class VideoSource extends BaseSource { ({ publicId, options } = normalizeOptions(publicId, options, { tolerateMissingId: true })); + if (!publicId && this.isRawUrl) { + return null; + } + if (!publicId) { publicId = this.publicId(); options = assign({}, options, DEFAULT_POSTER_PARAMS);