Skip to content

Commit

Permalink
revert(web): move shaka-player to an optional peer dependency and doc…
Browse files Browse the repository at this point in the history
…ument its installation
  • Loading branch information
jspizziri committed Feb 7, 2024
1 parent f0d3e1c commit cb2dede
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,30 @@ You can find us as part of the [React Native Track Player](https://discordapp.co
- `#show-and-tell` - Tell the community about the app you made with this project!
- `#news-and-releases` - Stay updated about the latest releases and dev efforts on the project.

### Web Notes
## Web

https://github.com/shaka-project/shaka-player/blob/7772099029acb47e6905a688f6cfc9c8738c6ff2/docs/tutorials/faq.md
RNTP is available on web. The web implementation leverages [shaka-player](https://github.com/shaka-project/shaka-player)
which is an optional peer dependency of the RNTP. If you want to deploy the web
platform you'll need to install `shaka-player` directly in your project:

```sh
yarn add shaka-player
```

### Web FAQ

See [`shaka-player`'s FAQ](https://github.com/shaka-project/shaka-player/blob/7772099029acb47e6905a688f6cfc9c8738c6ff2/docs/tutorials/faq.md)

### Web HLS

Q: Why doesn't my HLS content work?

A: If your HLS content uses MPEG2-TS, you may need to enable transmuxing. The only browsers capable of playing TS natively are Edge and Chromecast. You will get a CONTENT_UNSUPPORTED_BY_BROWSER error on other browsers due to their lack of TS support.
A: If your HLS content uses MPEG2-TS, you may need to enable transmuxing. The
only browsers capable of playing TS natively are Edge and Chromecast. You will
get a CONTENT_UNSUPPORTED_BY_BROWSER error on other browsers due to their lack
of TS support.

You can enable transmuxing by including mux.js v5.6.3+ in your application. If Shaka Player detects that mux.js has been loaded, we will use it to transmux TS content into MP4 on-the-fly, so that the content can be played by the browser.
You can enable transmuxing by including [mux.js](https://www.npmjs.com/package/mux.js)
v5.6.3+ in your application. If Shaka Player detects that mux.js has been
loaded, we will use it to transmux TS content into MP4 on-the-fly, so that the
content can be played by the browser.
3 changes: 2 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"react-native-vector-icons": "^10.0.0",
"react-native-web": "^0.18.10",
"react-native-windows": "0.71.12",
"react-scripts": "5.0.1"
"react-scripts": "5.0.1",
"shaka-player": "^4.7.9"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
8 changes: 4 additions & 4 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12144,10 +12144,10 @@ [email protected]:
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==

shaka-player@^4.3.2:
version "4.5.0"
resolved "https://registry.yarnpkg.com/shaka-player/-/shaka-player-4.5.0.tgz#99950e3be672e7ca23e751a85e2e373ad1ca2099"
integrity sha512-fEy4AW3lQQboOzpn0mJfCoVQ+T0sl8VZ+CWfa6w/6nsY+4z8i8dtQf1raihDYqY5vNvSmjYFrFVqE6iulUYMGg==
shaka-player@^4.7.9:
version "4.7.9"
resolved "https://registry.yarnpkg.com/shaka-player/-/shaka-player-4.7.9.tgz#5c283ba51781b5eb548c4db20d02944dffd44a85"
integrity sha512-eGaBZCYeYLejSM1vN5te0rjLKWrIs93Vr8i94DVLjRENyeNGZIeG4wHdhMcuTn1FaedMHOfb0k+GEIqA3LLbPw==
dependencies:
eme-encryption-scheme-polyfill "^2.1.1"

Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,18 @@
"bugs": {
"url": "https://github.com/doublesymmetry/react-native-track-player/issues"
},
"dependencies": {
"shaka-player": "^4.3.2"
},
"peerDependencies": {
"react": ">=16.8.6",
"react-native": ">=0.60.0-rc.2",
"react-native-windows": ">=0.63.0"
"react-native-windows": ">=0.63.0",
"shaka-player": "^4.7.9"
},
"peerDependenciesMeta": {
"react-native-windows": {
"optional": true
},
"shaka-player": {
"optional": true
}
},
"devDependencies": {
Expand All @@ -101,6 +102,7 @@
"react-native": "0.68.5",
"react-native-windows": "^0.65.0-0",
"rimraf": "^2.6.2",
"shaka-player": "^4.7.9",
"typescript": "^4.8.2"
},
"funding": "https://github.com/doublesymmetry/react-native-track-player?sponsor=1",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6200,7 +6200,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==

shaka-player@^4.3.2:
shaka-player@^4.7.9:
version "4.7.9"
resolved "https://registry.yarnpkg.com/shaka-player/-/shaka-player-4.7.9.tgz#5c283ba51781b5eb548c4db20d02944dffd44a85"
integrity sha512-eGaBZCYeYLejSM1vN5te0rjLKWrIs93Vr8i94DVLjRENyeNGZIeG4wHdhMcuTn1FaedMHOfb0k+GEIqA3LLbPw==
Expand Down

0 comments on commit cb2dede

Please sign in to comment.