nuxt-modules / cloudinary

Cloudinary Module for Nuxt
https://cloudinary.nuxtjs.org
MIT License
249 stars 34 forks source link

CldVideoPlayer refs not working #170

Closed Jeffrey-Suitor closed 9 months ago

Jeffrey-Suitor commented 10 months ago

Hey,

Maybe I'm just reading into something wrong for the package but I can't seem to expose either the video or player refs to my parent component.

Version

@nuxtjs/cloudinary 2.4.3 nuxt: 3.8.2

Reproduction Link

https://cloudinary.nuxtjs.org/components/cldvideoplayer

const myVideoRef = ref(); ... <CldVideoPlayer :videoRef="myVideoRef" ... />

https://stackblitz.com/edit/github-8vtd1k?file=.stackblitz%2Fapp.vue

Steps to reproduce

  1. Copy the example code provided at https://cloudinary.nuxtjs.org/components/cldvideoplayer . Look at the value of myVideoRef

What is Expected?

That the ref should be populated with the reference to the video element.

What is actually happening?

The ref is not populated

Baroshem commented 9 months ago

Hey there.

You are correct. This Ref wont work like that.

I have created a fix for that. Could you check if that works the way you would want it? I have tested it and with this approach, it is possible to get the access to the video and player refs from the parent component and also modify it via props.

https://github.com/nuxt-modules/cloudinary/pull/172

Jeffrey-Suitor commented 9 months ago

Hey there.

You are correct. This Ref wont work like that.

I have created a fix for that. Could you check if that works the way you would want it? I have tested it and with this approach, it is possible to get the access to the video and player refs from the parent component and also modify it via props.

172

Yes this works great thank you so much!