1- import { Plugins , HtmlPluginState , VideoSources , VideoType } from '../types.js'
1+ import { Plugins , HtmlPluginState , VideoSources , VideoType , VideoPoster } from '../types.js'
22import cloneDeep from 'lodash.clonedeep'
33import { CloudinaryImage , CloudinaryVideo } from "@cloudinary/url-gen" ;
44import { render } from '../utils/render.js' ;
@@ -13,7 +13,7 @@ export class HtmlVideoLayer{
1313 mimeType = 'video' ;
1414 mimeSubTypes = VIDEO_MIME_TYPES ;
1515
16- constructor ( element : HTMLVideoElement | null , userCloudinaryVideo : CloudinaryVideo , sources : VideoSources , plugins ?: Plugins , videoAttributes ?: object , userCloudinaryPoster ?: CloudinaryImage | 'auto' ) {
16+ constructor ( element : HTMLVideoElement | null , userCloudinaryVideo : CloudinaryVideo , sources : VideoSources , plugins ?: Plugins , videoAttributes ?: object , userCloudinaryPoster ?: VideoPoster ) {
1717 this . videoElement = element ;
1818 this . originalVideo = userCloudinaryVideo ;
1919 this . htmlPluginState = { cleanupCallbacks :[ ] , pluginEventSubscription : [ ] } ;
@@ -104,7 +104,7 @@ export class HtmlVideoLayer{
104104 * In case of poster, sets the poster.
105105 * @param videoAttributes {object} Supported attributes: controls, loop, muted, poster, preload, autoplay, playsinline
106106 */
107- setVideoAttributes ( videoAttributes : object = { } , userCloudinaryPoster ?: CloudinaryImage | 'auto' ) {
107+ setVideoAttributes ( videoAttributes : object = { } , userCloudinaryPoster ?: VideoPoster ) {
108108 if ( userCloudinaryPoster === 'auto' ) {
109109 videoAttributes [ 'poster' ] = this . originalVideo
110110 . quality ( 'auto' )
@@ -129,7 +129,7 @@ export class HtmlVideoLayer{
129129 * @param plugins
130130 * @param videoAttributes
131131 */
132- update ( updatedCloudinaryVideo : CloudinaryVideo , sources : VideoSources , plugins ?: Plugins , videoAttributes ?: object , userCloudinaryPoster ?: CloudinaryImage | 'auto' ) {
132+ update ( updatedCloudinaryVideo : CloudinaryVideo , sources : VideoSources , plugins ?: Plugins , videoAttributes ?: object , userCloudinaryPoster ?: VideoPoster ) {
133133 if ( updatedCloudinaryVideo !== this . originalVideo ) {
134134 const sourcesToDelete = this . videoElement . getElementsByTagName ( "SOURCE" ) ;
135135 while ( sourcesToDelete [ 0 ] ) sourcesToDelete [ 0 ] . parentNode . removeChild ( sourcesToDelete [ 0 ] ) ;
0 commit comments