Skip to content

v5.3.0 - getVideoPlayerOptions#157

Merged
colbyfayock merged 6 commits intomainfrom
beta
May 23, 2024
Merged

v5.3.0 - getVideoPlayerOptions#157
colbyfayock merged 6 commits intomainfrom
beta

Conversation

@colbyfayock
Copy link
Collaborator

@colbyfayock colbyfayock commented May 23, 2024

Description

This lifts the player options logic from Next Cloudinary, which should basically reflect Nuxt and Svelte.

This allows us to maintain a single set of configuration options for the player that will support each framework that creates a similar CldVideoPlayer component.

It would work as such:

const playerOptions = getVideoPlayerOptions(props, config);
videoPlayer(videoRef.current, playerOptions);

You can see some examples inside of the tests.

As of now, I left out className and id as returned options as the function's intent is to return "player options", which would be invalid values for the player. This in come cases could cause unintentional side effects, so opting to not return those.

A potential solution would be to return an object, with player options as a property, but i'm leaning towards it being an unintuitive return shape given the name of the function. Open to thoughts on this.

As far as where this module is located, I opted to include it in /url-loader with the idea being that the family of component support functions could live under that package and in a future major release, we could rename it to something more appropriate for all. I'm open to other ideas / suggestions on this.

Issue Ticket Number

Fixes #154

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

Description

Issue Ticket Number

Fixes #<ISSUE_NUMBER>

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

colbyfayock and others added 6 commits May 22, 2024 21:45
# Description

This lifts the player options logic from Next Cloudinary, which should
basically reflect Nuxt and Svelte.

This allows us to maintain a single set of configuration options for the
player that will support each framework that creates a similar
CldVideoPlayer component.

It would work as such:
```
const playerOptions = getVideoPlayerOptions(props, config);
videoPlayer(videoRef.current, playerOptions);
```

You can see some examples inside of the tests.

As of now, I left out `className` and `id` as returned options as the
function's intent is to return "player options", which would be invalid
values for the player. This in come cases could cause unintentional side
effects, so opting to not return those.

A potential solution would be to return an object, with player options
as a property, but i'm leaning towards it being an unintuitive return
shape given the name of the function. Open to thoughts on this.

As far as where this module is located, I opted to include it in
`/url-loader` with the idea being that the family of component support
functions could live under that package and in a future major release,
we could rename it to something more appropriate for all. I'm open to
other ideas / suggestions on this.

## Issue Ticket Number

Fixes #155 

<!-- Specify above which issue this fixes by referencing the issue
number (`#<ISSUE_NUMBER>`) or issue URL. -->
<!-- Example: Fixes
https://github.com/colbyfayock/cloudinary-util/issues/<ISSUE_NUMBER> -->

## Type of change

<!-- Please select all options that are applicable. -->

- [ ] 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

<!-- These must all be followed and checked. -->

- [ ] I have followed the contributing guidelines of this project as
mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md)
- [ ] I have created an
[issue](https://github.com/colbyfayock/cloudinary-util/issues) ticket
for this PR
- [ ] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/colbyfayock/cloudinary-util/pulls) 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
# Description

Oops, no exports!

## Issue Ticket Number

Fixes #<ISSUE_NUMBER>

<!-- Specify above which issue this fixes by referencing the issue
number (`#<ISSUE_NUMBER>`) or issue URL. -->
<!-- Example: Fixes
https://github.com/colbyfayock/cloudinary-util/issues/<ISSUE_NUMBER> -->

## Type of change

<!-- Please select all options that are applicable. -->

- [ ] 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

<!-- These must all be followed and checked. -->

- [ ] I have followed the contributing guidelines of this project as
mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md)
- [ ] I have created an
[issue](https://github.com/colbyfayock/cloudinary-util/issues) ticket
for this PR
- [ ] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/colbyfayock/cloudinary-util/pulls) 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
# Description

Public ID (or url) is required via the src prop for the video player. To
avoid player issues, throw error if not present.

## Issue Ticket Number

Fixes #<ISSUE_NUMBER>

<!-- Specify above which issue this fixes by referencing the issue
number (`#<ISSUE_NUMBER>`) or issue URL. -->
<!-- Example: Fixes
https://github.com/colbyfayock/cloudinary-util/issues/<ISSUE_NUMBER> -->

## Type of change

<!-- Please select all options that are applicable. -->

- [ ] 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

<!-- These must all be followed and checked. -->

- [ ] I have followed the contributing guidelines of this project as
mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md)
- [ ] I have created an
[issue](https://github.com/colbyfayock/cloudinary-util/issues) ticket
for this PR
- [ ] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/colbyfayock/cloudinary-util/pulls) 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
# [@cloudinary-util/url-loader-v5.3.0-beta.3](https://github.com/cloudinary-community/cloudinary-util/compare/@cloudinary-util/url-loader-v5.3.0-beta.2...@cloudinary-util/url-loader-v5.3.0-beta.3) (2024-05-23)

### Features

* Throw error if no public ID for video player options ([#159](#159)) ([973d5fa](973d5fa))
@colbyfayock colbyfayock merged commit 6744f0f into main May 23, 2024
@colbyfayock colbyfayock deleted the beta branch May 23, 2024 16:22
github-actions bot pushed a commit that referenced this pull request May 23, 2024
@github-actions
Copy link

🎉 This PR is included in version @cloudinary-util/url-loader-v5.3.0 🎉

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: getVideoPlayerOptions

2 participants