Skip to content

Add customPosterOptions #243

@billnbell3

Description

@billnbell3

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @nuxtjs/[email protected] for the project I'm working on.

Here is the diff that solved my problem:

--- a/node_modules/@nuxtjs/cloudinary/dist/runtime/components/CldVideoPlayer.vue
+++ b/node_modules/@nuxtjs/cloudinary/dist/runtime/components/CldVideoPlayer.vue
@@ -89,6 +89,7 @@ export type CldVideoPlayerProps = Pick<
   chapters?: Record<string | number, string> | boolean
   chaptersButton?: boolean
   disableRemotePlayback?: boolean
+  customPosterOptions?: object
 }
 
 const props = withDefaults(defineProps<CldVideoPlayerProps>(), {
@@ -118,7 +119,6 @@ const {
   width,
   config,
 } = props as CldVideoPlayerProps
-
 const playerTransformations = Array.isArray(transformation)
   ? transformation
   : [transformation]
@@ -202,6 +202,10 @@ const handleOnLoad = () => {
       playerOptions,
     )
 
+    if (props?.customPosterOptions) {
+      playerRef.value.posterOptions(props.customPosterOptions);
+    }
+
     Object.keys(events).forEach((key) => {
       if (typeof events[key] === 'function') {
         playerRef.value?.on(key, handleEvent)
@@ -247,6 +251,7 @@ useHead({
       :width="width"
       :height="height"
       :disableRemotePlayback="disableRemotePlayback"
+      :autoplay="Boolean(autoPlay)"
     />
   </div>
 </template>

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions