diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 94f23ef6..f77cc4e3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -56,10 +56,8 @@ jobs: - run: npm ci - run: npm run lint - run: npm run test:coverage - - run: npm run build:lib + - run: npm run build - run: npm run build:demo - - run: npm run build:dist - - run: npm run build:standalone - run: npx --yes wet-run@1.0.1 release ${{ inputs.version }} ${{ inputs.dryrun && '--dry-run' || '' }} ${{ inputs.prerelease && format('--prerelease {0}', inputs.prerelease) || '' }} --provenance --github-release --verbose - name: Get NPM version id: npm-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77eb9199..052df39f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,10 +58,8 @@ jobs: node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - - run: npm run build:lib + - run: npm run build - run: npm run build:demo - - run: npm run build:dist - - run: npm run build:standalone deploy-preview: # Grant GITHUB_TOKEN the permissions required to make a Pages deployment @@ -82,7 +80,7 @@ jobs: with: node-version: 20 - run: npm ci - - run: npm run build:lib + - run: npm run build - run: npm run build:demo - uses: actions/upload-pages-artifact@v3 with: diff --git a/.gitignore b/.gitignore index 9c251bfa..f987a30b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ yarn-error.log .idea/ .vscode/ /disttest/ +/dist/ diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 95c8dd78..00000000 --- a/.npmignore +++ /dev/null @@ -1,12 +0,0 @@ -.github -babel.config.js -codecov.yml -coverage -src -test -webpack/* -yarn-error.log -/demo/ -/examples/ -/disttest/ -/scripts/ diff --git a/MIGRATING.md b/MIGRATING.md index c27f6aad..3b3cefbf 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -1,3 +1,57 @@ +## Migrating to `v3.0` + +Breaking changes are in π₯ __bold and on fire__. + +### Some player providers are not supported yet + +Since `v3.0` is a new architecture not all providers have been updated. +It is recommended to keep using `v2` and vote to add this provider to `v3` in [discussions](https://github.com/cookpete/react-player/discussions). +These include: + + - `Dailymotion` + - `SoundCloud` + - `Streamable` + - `Twitch` + - `Facebook` + - `Mixcloud` + - `Kaltura` + +### Lazy players + +As of `v3.0` all the players are lazy loaded by default. +Due to the use of `lazy` and `Suspense`, π₯ __React 16.6 or later is now required__. + +### Player props + +As of `v3.0` some player props are renamed to be closer to the native +[HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) naming. + +- π₯ __`url` => `src`__ +- π₯ __`playsinline` => `playsInline`__ +- π₯ __`progressInterval` deprecated +- π₯ __`stopOnUnmount` => deprecated +- π₯ __`wrapper` is `undefined` by default. Set to `div` if you want a wrapper element. + +### Player instance methods + +As of `v3.0` use [`ref`](https://react.dev/learn/manipulating-the-dom-with-refs) to call instance methods on the player. See [the demo app](examples/react/src/App.js) for an example of this. Since `v3`, the instance methods aim to be π₯ __compatible +with the [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) interface__. + +### Player callback props + +As of `v3.0` some player callback props are renamed to be closer to the native +[HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) event naming. + +- π₯ __`onProgress` => `onTimeUpdate` and `onProgress`__ +- π₯ __`onDuration` => `onDurationChange`__ +- π₯ __`onPlaybackRateChange` => `onRateChange`__ +- π₯ __`onSeek` => `onSeeking` and `onSeeked`__ +- π₯ __`onBuffer` => `onWaiting`__ +- π₯ __`onBufferEnd` => `onPlaying`__ +- π₯ __`onEnablePIP` => `onEnterPictureInPicture`__ +- π₯ __`onDisablePIP` => `onLeavePictureInPicture`__ + + ## Migrating to `v2.0` Breaking changes are in π₯ __bold and on fire__. diff --git a/README.md b/README.md index aee04455..5d2a865f 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,14 @@
- A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, DailyMotion and Kaltura. Not using React? No problem. + A React component for playing a variety of URLs, including file paths, HLS, DASH, YouTube, Vimeo, Wistia and Mux.
--- +> Version 3 of ReactPlayer is a major update with a new architecture and many new features. It is not backwards compatible with v2, so please see the [migration guide](MIGRATING.md) for details. + + > Using Next.js and need to handle video upload/processing? Check out [next-video](https://github.com/muxinc/next-video). ### β¨ The future of ReactPlayer @@ -36,25 +39,7 @@ import ReactPlayer from 'react-player'