feat: respect browser standard autoplay props (#319)#350
Conversation
|
@DevYemi is attempting to deploy a commit to the Cloudinary DevX Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
next-cloudinary/src/components/CldVideoPlayer/CldVideoPlayer.tsx
Outdated
Show resolved
Hide resolved
next-cloudinary/src/components/CldVideoPlayer/CldVideoPlayer.tsx
Outdated
Show resolved
Hide resolved
|
hey @DevYemi looking good so far, two comments with questions additionally, part of the hope was to update the prop name to for backwards compatability, we can still recognize autoPlay, at least until I can remove it in a breaking release so perhaps you could do you can even add a check for |
Ohh my bad that's true i will make the corrections now, also you are right about backwards compatability and i will also be adding this checker: |
…into cldVidPlayer-autoplay-support
Renamed cldvideoplayer autoPlay props to autoplay but also kept supporting autoPlay in codebase for backward compactibility.
| let playerOptions: CloudinaryVideoPlayerOptions = { | ||
| autoplayMode: autoPlay, | ||
| autoplayMode: autoplayModeValue, | ||
| autoPlay: autoPlayValue, |
There was a problem hiding this comment.
i think this needs to be a lowercase "p" as well https://cloudinary.com/documentation/video_player_api_reference#player_behavior
|
i think this is looking good, i thin kit just needs 1 fix to the Player types as commented |
I was wrongfully passing autoPlay to cloudinaryVideoPlayerOptions and this mistake was corrected in this commit.
…into cldVidPlayer-autoplay-support
|
hey @DevYemi sorry for the hold up but noticing that autoplay doesnt actually work as expected im playing around with this branch and it appears its because you're defining if I change the it works as expected in addition to that, we can optionally set the value, but i would recommend just leaving it undefined unless someone passes in a string as the rest of the logic has it thoughts? |
I believe the suggestion you made is very valid, i will make the corrections and push before night fall today. just a question should i also do the same for autoplay ?, sets the value to undefined if no value is passed. The current implementation falls back to false current implementation is: proposed option: what do you think ? |
|
doesnt hurt to remove the default as well as it realisticly doesnt do anything as both would be a falsey value that wouldnt trigger it. i dont have a strong opinion on it |
…into cldVidPlayer-autoplay-support
Made changes to the fallback passed to autoplayModeValue, now value falls back to undefined instead of default "never".
|
changes look good, thank you @DevYemi |
|
🎉 This PR is included in version 5.14.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [5.14.0](cloudinary-community/next-cloudinary@v5.13.0...v5.14.0) (2023-12-20) ### Features * respect browser standard autoplay props ([#319](cloudinary-community/next-cloudinary#319)) ([#350](cloudinary-community/next-cloudinary#350)) ([614dd81](cloudinary-community/next-cloudinary@614dd81))
Description
Implemented a single point of value passage for both
autoplayandautoplayModeincldvideoplayer.In summary if the value type of
autoplayprops passed tocldvideoplayeris a string value then its value will be assigned toautoplayModein theplayerOptionsbut if the value typeautoplayprops is a boolean value type then its value will be assigned toautoplayin theplayerOptions.Issue Ticket Number
Fixes #319
Type of change
Checklist