Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] 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
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ yarn-error.log
.idea/
.vscode/
/disttest/
/dist/
12 changes: 0 additions & 12 deletions .npmignore

This file was deleted.

54 changes: 54 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -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__.
Expand Down
220 changes: 57 additions & 163 deletions README.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"files": {
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"],
"ignore": ["dist/**"]
},
"formatter": {
"indentStyle": "space"
}
}
3 changes: 0 additions & 3 deletions dist/ReactPlayer.js

This file was deleted.

7 changes: 0 additions & 7 deletions dist/ReactPlayer.js.map

This file was deleted.

33 changes: 0 additions & 33 deletions dist/ReactPlayer.standalone.es6.js

This file was deleted.

45 changes: 0 additions & 45 deletions dist/ReactPlayer.standalone.js

This file was deleted.

7 changes: 0 additions & 7 deletions dist/ReactPlayer.standalone.js.map

This file was deleted.

9 changes: 4 additions & 5 deletions examples/react/public/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@

.player-wrapper {
width: 480px;
height: 270px;
}

.react-player {
margin-bottom: 10px;
aspect-ratio: 16 / 9;
background: rgba(0, 0, 0, .1);
margin-bottom: 10px;
}

.react-player {}

.faded {
color: rgba(0, 0, 0, .5);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/react/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel='stylesheet' href='./defaults.css'>
<link rel='stylesheet' href='./range.css'>
<link rel='stylesheet' href='./App.css'>
<script defer src='./index.js'></script>
<script type='module' src='./index.js'></script>
</head>
<body>
<div id='app'></div>
Expand Down
Loading