Skip to content

Releases: Gyanreyer/react-hover-video-player

v10.0.1

05 Jun 16:44
Compare
Choose a tag to compare

This is a minor bug fix release.

Full changes

Changes

  • Fixes issue where the library's published TypeScript declaration file was not working in most TypeScript projects
  • Minor documentation updates

v10.0.0

16 Mar 16:42
Compare
Choose a tag to compare

This is a big release! It includes some breaking changes to the component's API, but should reduce the bundle size by ~18% and improve performance by simply removing a lot of unnecessary work that the component was doing at runtime before.

Full changes

Breaking changes

Deprecates passing config objects to videoSrc prop

The videoSrc prop still supports URL strings,
but no longer accepts config objects or arrays of config objects for video sources.
Instead, sources like this must now be defined as <source> elements.

Migration for a single source config object is fairly straightforward; the src and type properties
on the config objects map directly to the attributes that need to be set on the <source> elements:

<HoverVideoPlayer
- videoSrc={{
-   src: "path-to/video.mp4",
-   type: "video/mp4",
- }}
+ videoSrc={(
+   <source
+     src="path-to/video.mp4"
+     type="video/mp4"
+   />
+ )}
/>

For an array of source config objects, simply wrap your <source> elements in a fragment:

<HoverVideoPlayer
- videoSrc={[
-   {
-     src: "video.webm",
-     type: "video/webm",
-   },
-   {
-     src: "video.mp4",
-     type: "video/mp4",
-   },
- ]}
+ videoSrc={(
+   <>
+     <source src="video.webm" type="video/webm" />
+     <source src="video.mp4" type="video/mp4" />
+   </>
+ )}
/>

Deprecates passing config objects to videoCaptions prop

The videoCaptions prop also no longer accepts config objects for caption tracks.
Instead, caption tracks must be defined as <track> elements.

Like with the changes to videoSrc above, all of the properties on the caption track config objects should map directly to
attributes on the <track> elements:

<HoverVideoPlayer
  videoSrc="video.mp4"
- videoCaptions={[
-   {
-     src: "english-captions.vtt",
-     srcLang: "en",
-     label: "English",
-     kind: "captions",
-     default: true,
-   },
-   {
-     src: "french-subtitles.vtt",
-     srcLang: "fr",
-     label: "Francais",
-     kind: "subtitles",
-   },
- ]}
+ videoCaptions={(
+   <>
+     <track src="english-captions.vtt" srcLang="en" label="English" kind="captions" default />
+     <track src="french-subtitles.vtt" srcLang="fr" label="Francais" kind="subtitles" />
+   </>
+ )}
/>

Removes shouldSuppressPlaybackInterruptedErrors prop

The shouldSuppressPlaybackInterruptedErrors prop is being removed, as it is not really needed anymore.

This prop defaulted to true and was not commonly used, so will likely not impact many people. You can simply remove the prop and things will continue functioning as normal.

<HoverVideoPlayer
  videoSrc="video.mp4"
- shouldSuppressPlaybackInterruptedErrors={false}
/>

Other things of note

  • Replaces Rollup with esbuild for builds
  • Replaces Cypress with Playwright for tests
  • Drops commit message formatting requirements, eases eslint rules in an effort to make it easier for other people to contribute
  • Switches CI from CircleCI to Github Actions, simplifies CI usage to only run tests

v9.7.1

05 Oct 13:37
7dfab5f
Compare
Choose a tag to compare

9.7.1 (2022-10-05)

Bug Fixes

  • hovervideoplayer: remove default "anonymous" value for crossOrigin prop (b6b3f8d), closes #83 #84

v9.7.0

15 Jul 20:00
889d9f8
Compare
Choose a tag to compare

9.7.0 (2022-07-15)

Features

  • hovervideoplayer: enable passing through generic attributes to the container div (ff0593c), closes #81

v9.6.1

16 Jun 19:58
1b9a678
Compare
Choose a tag to compare

9.6.1 (2022-06-16)

Bug Fixes

  • changes to support usage in nextjs (57fb0e2)

v9.6.0

29 May 20:36
Compare
Choose a tag to compare

9.6.0 (2022-05-29)

Features

  • hovervideoplayer: add playbackStartDelay prop (0913fb4), closes #77

v9.5.0

31 Mar 00:33
27d6c3e
Compare
Choose a tag to compare

9.5.0 (2022-03-31)

Features

  • add shouldSuppressPlaybackInterruptedErrors prop (2be89be), closes #71
  • improve handling for changes to the videoSrc prop (50f81a8), closes #72

v9.4.0

30 Oct 23:21
64b8d98
Compare
Choose a tag to compare

9.4.0 (2021-10-30)

v9.3.2

30 Oct 19:39
72843e2
Compare
Choose a tag to compare

9.3.2 (2021-10-30)

Bug Fixes

  • add explicit handling for playback errors which aren't a NotAllowedError (2d046dd)

v9.3.1

06 Oct 17:51
3cf9fa8
Compare
Choose a tag to compare

9.3.1 (2021-10-06)

Bug Fixes

  • only run playback range update loop while the video is playing (3c10998)
  • hovervideoplayer: fix playback for unmuted videos getting blocked by browser autoplay policies (1a2d2b0), closes #64