Skip to content

Conversation

@sahil9001
Copy link
Contributor

@sahil9001 sahil9001 commented Oct 3, 2024

Description

Updates the Video Player to use the useId hook to reliably generate a unique player ID.

Issue Ticket Number

Fixes #493

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Fix or improve the documentation
  • This change requires a documentation update

Checklist

  • I have followed the contributing guidelines of this project as mentioned in CONTRIBUTING.md
  • I have created an issue ticket for this PR
  • I have checked to ensure there aren't other open Pull Requests for the same update/change?
  • I have performed a self-review of my own code
  • I have run tests locally to ensure they all pass
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes needed to the documentation

@vercel
Copy link

vercel bot commented Oct 3, 2024

@sahil9001 is attempting to deploy a commit to the Cloudinary DevX Team on Vercel.

A member of the Team first needs to authorize it.

@sahil9001
Copy link
Contributor Author

Relates to #493

@vercel
Copy link

vercel bot commented Oct 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
next-cloudinary ✅ Ready (Inspect) Visit Preview Oct 3, 2024 7:20pm

@colbyfayock
Copy link
Collaborator

@sahil9001 this seems to work pretty well

1 thing i noticed is if you go to the Examples page and remove all of the IDs, which with this working properly should work, but it ends up breaking player configurations

i tested locally replacing the : in the unique ID with nothing and that seemed to work

const playerId = id || `player-${uniqueId.replace(/:/g, '')}`;

@sahil9001
Copy link
Contributor Author

Thanks @colbyfayock , I have added that now, please have a look.

@colbyfayock colbyfayock merged commit 682f4c2 into cloudinary-community:main Oct 3, 2024
@colbyfayock
Copy link
Collaborator

seems to work perfectly! thanks @sahil9001

This PR qualifies for free Hacktoberfest swag from Cloudinary. Please email me at hacktoberfest@cloudinary.com with your name, GitHub username, and a link to this PR

@colbyfayock
Copy link
Collaborator

@all-contributors please add @sahil9001 for code

@allcontributors
Copy link
Contributor

@colbyfayock

I've put up a pull request to add @sahil9001! 🎉

github-actions bot pushed a commit that referenced this pull request Oct 3, 2024
# [6.14.0](v6.13.0...v6.14.0) (2024-10-03)

### Features

* added unique id generation using React's `useId()` hook ([#529](#529)) ([682f4c2](682f4c2)), closes [#493](#493)
@github-actions
Copy link

github-actions bot commented Oct 3, 2024

🎉 This PR is included in version 6.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

colbyfayock pushed a commit that referenced this pull request Oct 3, 2024
Adds @sahil9001 as a contributor for code.

This was requested by colbyfayock [in this
comment](#529 (comment))

[skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Oct 14, 2024
# [7.0.0-beta.3](v7.0.0-beta.2...v7.0.0-beta.3) (2024-10-14)

### Bug Fixes

* removed ts-ignore ([#535](#535)) ([32931c9](32931c9)), closes [#426](#426)
* use more proper type to derive `CldVideoPlayerProps` ([#537](#537)) ([65c3dd1](65c3dd1))

### Features

* added unique id generation using React's `useId()` hook ([#529](#529)) ([682f4c2](682f4c2)), closes [#493](#493)
@github-actions
Copy link

🎉 This PR is included in version 7.0.0-beta.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] useId hook for supplying a unique ID for Player instances

2 participants