Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
younes200 committed Feb 29, 2024
2 parents 4380587 + 75258ef commit f71e2c8
Show file tree
Hide file tree
Showing 21 changed files with 516 additions and 125 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CD

concurrency: production

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
version:
type: choice
required: true
description: Version
options:
- conventional
- patch
- minor
- major
- prerelease
- from-package
- from-git
prerelease:
type: choice
description: Pre-release
options:
-
- canary
- beta
dryrun:
description: 'Dry-run'
type: boolean

run-name: Deploy ${{ inputs.version }} ${{ inputs.dryrun && '--dry-run' || '' }} ${{ inputs.prerelease && format('--prerelease {0}', inputs.prerelease) || '' }}

jobs:
deploy:
runs-on: ubuntu-latest
environment: production
permissions:
contents: write
id-token: write

env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/setup-node@v4
with:
node-version: 20
# this line is required for the setup-node action to be able to run the npm publish below.
registry-url: 'https://registry.npmjs.org'
- uses: fregante/setup-git-user@v1
- run: npm ci
- run: npm run lint
- run: npm run test:coverage
- run: npm run build:lib
- 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
uses: martinbeentjes/[email protected]
- name: Released ${{ steps.npm-version.outputs.current-version}} ✨
run: echo ${{ steps.npm-version.outputs.current-version}}
72 changes: 51 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,90 @@ name: Node.js CI

on: [push, pull_request]

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
# node-version: [16.x, 18.x, 20.x]
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run build:lib
- run: npm run build:demo
- run: npm run build:dist
- run: npm run build:standalone
- run: npm run lint

lint:
test:
runs-on: ubuntu-latest

strategy:
matrix:
# node-version: [16.x, 18.x, 20.x]
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run test:coverage

test:
build:
runs-on: ubuntu-latest

strategy:
matrix:
# node-version: [16.x, 18.x, 20.x]
node-version: [16.x]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run test:coverage
- run: npm run build:lib
- 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
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-preview
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build:lib
- run: npm run build:demo
- uses: actions/upload-pages-artifact@v3
with:
path: './demo'
- uses: actions/deploy-pages@v4
id: deployment
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.github
.travis.yml
babel.config.js
codecov.yml
coverage
src
test
webpack/*
yarn-error.log
/demo/
/examples/
/disttest/
/scripts/
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

37 changes: 35 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,42 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v2.15.0](https://github.com/cookpete/react-player/compare/v2.14.1...v2.15.0)

- chore(cd): remove --changelog b/c auto-changelog [`#1750`](https://github.com/cookpete/react-player/pull/1750)
- feat: add Mux player [`#1748`](https://github.com/cookpete/react-player/pull/1748)
- chore(github-pages): add demo preview [`#1747`](https://github.com/cookpete/react-player/pull/1747)
- chore: remove unneeded config files [`#1744`](https://github.com/cookpete/react-player/pull/1744)
- Add aria-label to Preview component [`#1705`](https://github.com/cookpete/react-player/pull/1705)
- Add Deno-specific browser check [`#1632`](https://github.com/cookpete/react-player/pull/1632)
- docs: fix badges [`#1735`](https://github.com/cookpete/react-player/pull/1735)

#### [v2.14.1](https://github.com/cookpete/react-player/compare/v2.14.0...v2.14.1)

> 19 December 2023
- fix: cjs interop require default pita [`#1722`](https://github.com/cookpete/react-player/pull/1722)
- docs(CHANGELOG): 2.14.1 [`921b0e0`](https://github.com/cookpete/react-player/commit/921b0e01148925f048716435333fcdc9ce2df24a)
- chore(release): 2.14.1 [`8ca9747`](https://github.com/cookpete/react-player/commit/8ca974794db1c7f8cacf4ae1580671548cdf5491)
- chore: npm ignore unneeded folders [`678f466`](https://github.com/cookpete/react-player/commit/678f466553d36dc02dfe2b926a31e8694b746842)

#### [v2.14.0](https://github.com/cookpete/react-player/compare/v2.13.0...v2.14.0)

> 14 December 2023
- fix: repo url [`#1709`](https://github.com/cookpete/react-player/pull/1709)
- fix: pkg repository.url [`#1708`](https://github.com/cookpete/react-player/pull/1708)
- chore: add CD workflow [`#1706`](https://github.com/cookpete/react-player/pull/1706)
- chore: use Node matrix with 16.x, 18.x, 20.x [`#1688`](https://github.com/cookpete/react-player/pull/1688)
- docs: update demo App.js link [`#1689`](https://github.com/cookpete/react-player/pull/1689)
- fix: modernize build using esbuild [`#1684`](https://github.com/cookpete/react-player/pull/1684)
- docs(CHANGELOG): 2.14.0 [`e018c42`](https://github.com/cookpete/react-player/commit/e018c4255dee89a1684f2fff8b1cb4db81ad2cce)
- chore(release): 2.14.0 [`1496f67`](https://github.com/cookpete/react-player/commit/1496f679fcefae26ecb5b1ea77c75b36f401dd90)

#### [v2.13.0](https://github.com/cookpete/react-player/compare/v2.12.0...v2.13.0)

> 5 September 2023
- Fix #1604 - FilePlayer does not work if I passed an array of urls [`#1612`](https://github.com/cookpete/react-player/pull/1612)
- fix: `src` sttribute become "undefinded" if `url` is an array [`#1648`](https://github.com/cookpete/react-player/pull/1648)
- Adding keepPlaying to other player types [`#1639`](https://github.com/cookpete/react-player/pull/1639)
Expand Down Expand Up @@ -672,7 +706,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Add standalone player [`4ffd201`](https://github.com/cookpete/react-player/commit/4ffd20112f18c2c7b3c25e39c283f8cfe9be88fc)
- Update description and keywords [`0194b43`](https://github.com/cookpete/react-player/commit/0194b43758fccbbda755d13d9eb0d2a4a80aba77)

#### [v1.0.0](https://github.com/cookpete/react-player/compare/v1.0.0-beta.7...v1.0.0)
### [v1.0.0](https://github.com/cookpete/react-player/compare/v1.0.0-beta.7...v1.0.0)

> 17 January 2018
Expand Down Expand Up @@ -914,7 +948,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
> 5 May 2017
- Fix initial loading bug for Private Vimeo videos [`#187`](https://github.com/cookpete/react-player/pull/187)
- Fix initial loading bug for Private Vimeo videos [`ff8a449`](https://github.com/cookpete/react-player/commit/ff8a449546121be7bfd6f3bb357d9dc06a94fcaa)

#### [v0.17.0](https://github.com/cookpete/react-player/compare/v0.16.0...v0.17.0)

Expand Down
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
</h1>

<p align='center'>
<a href='https://www.npmjs.com/package/react-player'>
<img src='https://img.shields.io/npm/v/react-player.svg' alt='Latest npm version'>
</a>
<a href='https://codecov.io/gh/CookPete/react-player'>
<img src='https://img.shields.io/codecov/c/github/cookpete/react-player.svg' alt='Test Coverage'>
</a>
<a href='https://www.patreon.com/cookpete'>
<img src='https://img.shields.io/badge/sponsor-patreon-fa6854.svg' alt='Become a sponsor on Patreon'>
</a>
<a href='https://www.npmjs.com/package/react-player'><img src='https://img.shields.io/npm/v/react-player.svg' alt='Latest npm version'></a>
<a href='https://codecov.io/gh/CookPete/react-player'><img src='https://img.shields.io/codecov/c/github/cookpete/react-player.svg' alt='Test Coverage'></a>
<a href='https://www.patreon.com/cookpete'><img src='https://img.shields.io/badge/sponsor-patreon-fa6854.svg' alt='Become a sponsor on Patreon'></a>
</p>

<p align='center'>
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? <a href='#standalone-player'>No problem.</a>
</p>

---

> Using Next.js and need to handle video upload/processing? Check out [next-video](https://github.com/muxinc/next-video).
### ✨ The future of ReactPlayer

Maintenance of ReactPlayer is being taken over by [Mux](https://www.mux.com). The team at Mux have worked on many highly respected projects and are committed to improving video tooling for developers.
Expand Down Expand Up @@ -58,17 +56,12 @@ import ReactPlayer from 'react-player/lazy'
<ReactPlayer url='https://www.youtube.com/watch?v=ysz5S6PUM-U' />
```

Demo page: [`https://cookpete.com/react-player`](https://cookpete.com/react-player)
Demo page: [`https://cookpete.github.io/react-player`](https://cookpete.github.io/react-player)

The component parses a URL and loads in the appropriate markup and external SDKs to play media from [various sources](#supported-media). [Props](#props) can be passed in to control playback and react to events such as buffering or media ending. See [the demo source](https://github.com/cookpete/react-player/blob/master/src/demo/App.js) for a full example.
The component parses a URL and loads in the appropriate markup and external SDKs to play media from [various sources](#supported-media). [Props](#props) can be passed in to control playback and react to events such as buffering or media ending. See [the demo source](https://github.com/cookpete/react-player/blob/master/examples/react/src/App.js) for a full example.

For platforms without direct use of `npm` modules, a minified version of `ReactPlayer` is located in `dist` after installing. To generate this file yourself, checkout the repo and run `npm run build:dist`.

#### Polyfills

* If you are using `npm` and need to support [browsers without `Promise`](http://caniuse.com/#feat=promises) you will need a [`Promise` polyfill](https://github.com/stefanpenner/es6-promise).
* To support IE11 you will need to use [`babel-polyfill`](https://babeljs.io/docs/usage/polyfill) or a similar ES2015+ polyfill.

#### Autoplay

As of Chrome 66, [videos must be `muted` in order to play automatically](https://www.theverge.com/2018/3/22/17150870/google-chrome-autoplay-videos-sound-mute-update). Some players, like Facebook, cannot be unmuted until the user interacts with the video, so you may want to enable `controls` to allow users to unmute videos themselves. Please set `muted={true}`.
Expand Down Expand Up @@ -147,13 +140,14 @@ Key | Options
`facebook` | `appId`: Your own [Facebook app ID](https://developers.facebook.com/docs/apps/register#app-id)<br />`version`: Facebook SDK version<br />`playerId`: Override player ID for consistent server-side rendering (use with [`react-uid`](https://github.com/thearnica/react-uid))<br />`attributes`: Extra data attributes to pass to the `fb-video` element
`soundcloud` | `options`: Override the [default player options](https://developers.soundcloud.com/docs/api/html5-widget#params)
`vimeo` | `playerOptions`: Override the [default params](https://developer.vimeo.com/player/sdk/embed)<br />`title`: Set the player `iframe` title attribute
`mux` | `attributes`: Apply [element attributes](https://github.com/muxinc/elements/blob/main/packages/mux-player/REFERENCE.md#attributes)<br />`version`: Mux player version
`wistia` | `options`: Override the [default player options](https://wistia.com/doc/embed-options#options_list)<br />`playerId`: Override player ID for consistent server-side rendering (use with [`react-uid`](https://github.com/thearnica/react-uid))
`mixcloud` | `options`: Override the [default player options](https://www.mixcloud.com/developers/widget/#methods)
`dailymotion` | `params`: Override the [default player vars](https://developer.dailymotion.com/player#player-parameters)
`twitch` | `options`: Override the [default player options](https://dev.twitch.tv/docs/embed)<br />`playerId`: Override player ID for consistent server-side rendering (use with [`react-uid`](https://github.com/thearnica/react-uid))
`peertube` | `options`: Override the [default player options](https://docs.joinpeertube.org/api-embed-player)
`file` | `attributes`: Apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes)<br />`forceVideo`: Always render a `<video>` element<br />`forceAudio`: Always render an `<audio>` element<br />`forceHLS`: Use [hls.js](https://github.com/video-dev/hls.js) for HLS streams<br />`forceSafariHLS`: Use [hls.js](https://github.com/video-dev/hls.js) for HLS streams, [even on Safari](https://github.com/cookpete/react-player/pull/1560)<br />`forceDisableHLS`: Disable usage [hls.js](https://github.com/video-dev/hls.js) for HLS streams<br />`forceDASH`: Always use [dash.js](https://github.com/Dash-Industry-Forum/dash.js) for DASH streams<br />`forceFLV`: Always use [flv.js](https://github.com/Bilibili/flv.js)<br />`hlsOptions`: Override the [default `hls.js` options](https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning)<br />`hlsVersion`: Override the [`hls.js`](https://github.com/video-dev/hls.js) version loaded from [`jsdelivr`](https://www.jsdelivr.com/package/npm/hls.js), default: `0.13.1`<br />`dashVersion`: Override the [`dash.js`](https://github.com/Dash-Industry-Forum/dash.js) version loaded from [`cdnjs`](https://cdnjs.com/libraries/dashjs), default: `2.9.2`<br />`flvVersion`: Override the [`flv.js`](https://github.com/Bilibili/flv.js) version loaded from [`jsdelivr`](https://www.jsdelivr.com/package/npm/flv.js), default: `1.5.0`

`peertube` | `options`: Override the [default player options](https://docs.joinpeertube.org/api-embed-player)
### Methods

#### Static Methods
Expand Down Expand Up @@ -239,7 +233,7 @@ You can use your own version of any player SDK, assuming the correct `window` gl
If you aren’t using React, you can still render a player using the standalone library:

```html
<script src='https://unpkg.com/react-player/dist/ReactPlayer.standalone.js'></script>
<script src='https://cdn.jsdelivr.net/npm/react-player/dist/ReactPlayer.standalone.js'></script>
<script>
const container = document.getElementById('container')
const url = 'https://www.youtube.com/watch?v=d46Azg3Pm4c'
Expand Down Expand Up @@ -334,8 +328,8 @@ ReactPlayer `v2.0` changes single player imports and adds lazy loading players.
* Facebook videos use the [Facebook Embedded Video Player API](https://developers.facebook.com/docs/plugins/embedded-video-player/api)
* SoundCloud tracks use the [SoundCloud Widget API](https://developers.soundcloud.com/docs/api/html5-widget)
* Streamable videos use [`Player.js`](https://github.com/embedly/player.js)
* Vidme videos are [no longer supported](https://medium.com/vidme/goodbye-for-now-120b40becafa)
* Vimeo videos use the [Vimeo Player API](https://developer.vimeo.com/player/sdk)
* Mux videos use the [`<mux-player>`](https://github.com/muxinc/elements/blob/main/packages/mux-player/README.md) element
* Wistia videos use the [Wistia Player API](https://wistia.com/doc/player-api)
* Twitch videos use the [Twitch Interactive Frames API](https://dev.twitch.tv/docs/embed#interactive-frames-for-live-streams-and-vods)
* DailyMotion videos use the [DailyMotion Player API](https://developer.dailymotion.com/player)
Expand Down
Loading

0 comments on commit f71e2c8

Please sign in to comment.