feat: Prints the error on problem sharing YouTube video.

This commit is contained in:
damencho 2022-12-12 08:00:42 -06:00 committed by Дамян Минков
parent ef2631e95a
commit 338b02a6b6
4 changed files with 16 additions and 46 deletions

52
package-lock.json generated
View File

@ -121,7 +121,7 @@
"react-textarea-autosize": "8.3.0",
"react-transition-group": "2.4.0",
"react-window": "1.8.6",
"react-youtube": "7.13.1",
"react-youtube": "10.1.0",
"redux": "4.0.4",
"redux-thunk": "2.4.1",
"resemblejs": "4.0.0",
@ -16766,36 +16766,21 @@
}
},
"node_modules/react-youtube": {
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/react-youtube/-/react-youtube-7.13.1.tgz",
"integrity": "sha512-b++TLHmHDpd0ZBS1wcbYabbuchU+W4jtx5A2MUQX0BINNKKsaIQX29sn/aLvZ9v5luwAoceia3VGtyz9blaB9w==",
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/react-youtube/-/react-youtube-10.1.0.tgz",
"integrity": "sha512-ZfGtcVpk0SSZtWCSTYOQKhfx5/1cfyEW1JN/mugGNfAxT3rmVJeMbGpA9+e78yG21ls5nc/5uZJETE3cm3knBg==",
"dependencies": {
"fast-deep-equal": "3.1.3",
"prop-types": "15.7.2",
"prop-types": "15.8.1",
"youtube-player": "5.5.2"
},
"engines": {
"node": ">= 10.x"
"node": ">= 14.x"
},
"peerDependencies": {
"react": ">=0.14.1"
}
},
"node_modules/react-youtube/node_modules/prop-types": {
"version": "15.7.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
"integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
"dependencies": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.8.1"
}
},
"node_modules/react-youtube/node_modules/react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"node_modules/readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
@ -32978,30 +32963,13 @@
}
},
"react-youtube": {
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/react-youtube/-/react-youtube-7.13.1.tgz",
"integrity": "sha512-b++TLHmHDpd0ZBS1wcbYabbuchU+W4jtx5A2MUQX0BINNKKsaIQX29sn/aLvZ9v5luwAoceia3VGtyz9blaB9w==",
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/react-youtube/-/react-youtube-10.1.0.tgz",
"integrity": "sha512-ZfGtcVpk0SSZtWCSTYOQKhfx5/1cfyEW1JN/mugGNfAxT3rmVJeMbGpA9+e78yG21ls5nc/5uZJETE3cm3knBg==",
"requires": {
"fast-deep-equal": "3.1.3",
"prop-types": "15.7.2",
"prop-types": "15.8.1",
"youtube-player": "5.5.2"
},
"dependencies": {
"prop-types": {
"version": "15.7.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
"integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
"requires": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.8.1"
}
},
"react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
}
}
},
"readable-stream": {

View File

@ -126,7 +126,7 @@
"react-textarea-autosize": "8.3.0",
"react-transition-group": "2.4.0",
"react-window": "1.8.6",
"react-youtube": "7.13.1",
"react-youtube": "10.1.0",
"redux": "4.0.4",
"redux-thunk": "2.4.1",
"resemblejs": "4.0.0",

View File

@ -209,10 +209,12 @@ class AbstractVideoManager extends PureComponent<Props> {
/**
* Handle video error.
*
* @param {Object|undefined} e - The error returned by the API or none.
* @returns {void}
*/
onError() {
logger.error('Error in the video player');
onError(e) {
logger.error('Error in the video player', e?.data,
e?.data ? 'Check error code at https://developers.google.com/youtube/iframe_api_reference#onError' : '');
this.props._stopSharedVideo();
this.props._displayWarning();
}

View File

@ -201,7 +201,7 @@ class YoutubeVideoManager extends AbstractVideoManager {
'rel': 0
}
},
onError: () => this.onError(),
onError: e => this.onError(e),
onReady: this.onPlayerReady,
onStateChange: this.onPlayerStateChange,
videoId