Skip to content

Commit

Permalink
feat(FEC-13652): add meaningful error message (#105)
Browse files Browse the repository at this point in the history
### Description of the Changes

add meaningful error message when firing a critical error.

<img width="789" alt="image" src="https://github.com/kaltura/playkit-js-vr/assets/79077248/52ba32be-d5e9-4f0a-becd-92641ebf3a1c">

Solves FEC-13652
  • Loading branch information
lianbenjamin authored Apr 7, 2024
1 parent 57fda2e commit 7cda458
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 102 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"flow-bin": "^0.129.0",
"husky": "^4.2.5",
"istanbul": "^0.4.5",
"@playkit-js/kaltura-player-js": "latest",
"@playkit-js/kaltura-player-js": "3.17.13-canary.0-0eb945c",
"karma": "^5.1.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
Expand All @@ -103,7 +103,7 @@
"webpack-dev-server": "^3.11.0"
},
"peerDependencies": {
"@playkit-js/kaltura-player-js": "latest"
"@playkit-js/kaltura-player-js": "3.17.13-canary.0-0eb945c"
},
"publishConfig": {
"access": "public"
Expand Down
14 changes: 12 additions & 2 deletions src/cast-player.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import {cast as remote, core} from '@playkit-js/kaltura-player-js';
/** @jsx h */
import {cast as remote, core, ui} from '@playkit-js/kaltura-player-js';
import {CastStateManager} from './cast-state-manager';
import {CastTracksManager} from './cast-tracks-manager';
import {CastPlaybackEngine} from './cast-playback-engine';
Expand All @@ -8,6 +9,11 @@ import {CastLoader} from './cast-loader';
import {CastAdsController} from './cast-ads-controller';
import {CastAdsManager} from './cast-ads-manager';

// eslint-disable-next-line no-unused-vars
const {h} = ui;
// eslint-disable-next-line no-unused-vars
const {Text} = ui.preacti18n;

const {Env, Track, TextStyle, EventType, StateType, FakeEvent, Utils, EngineType, AbrMode, Error} = core;
const {
BaseRemotePlayer,
Expand Down Expand Up @@ -840,8 +846,12 @@ class CastPlayer extends BaseRemotePlayer {
_onLoadMediaFailed(error: Object): void {
CastPlayer._logger.debug('Load media falied', error);
const errorDetails = {
errorTitle: <Text id={'cast.error_title'} />,
errorMessage: <Text id={'cast.error_message'} />
};
this.dispatchEvent(
new FakeEvent(EventType.ERROR, new Error(Error.Severity.CRITICAL, Error.Category.CAST, Error.Code.CAST_LOAD_MEDIA_FAILED, error))
new FakeEvent(EventType.ERROR, new Error(Error.Severity.CRITICAL, Error.Category.CAST, Error.Code.CAST_LOAD_MEDIA_FAILED, error, errorDetails))
);
}
Expand Down
8 changes: 8 additions & 0 deletions translations/en.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"en": {
"cast": {
"error_title": "Media casting error",
"error_message": "An error occurred while trying to cast, please try again."
}
}
}
157 changes: 59 additions & 98 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -796,14 +796,6 @@
"@babel/helper-create-regexp-features-plugin" "^7.10.4"
"@babel/helper-plugin-utils" "^7.10.4"

"@babel/polyfill@^7.0.0":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.10.4.tgz#915e5bfe61490ac0199008e35ca9d7d151a8e45a"
integrity sha512-8BYcnVqQ5kMD2HXoHInBH7H1b/uP3KdnwCYXOqFnXqguOyuu443WXusbIUbWEfY3Z0Txk0M1uG/8YuAMhNl6zg==
dependencies:
core-js "^2.6.5"
regenerator-runtime "^0.13.4"

"@babel/preset-env@^7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.10.4.tgz#fbf57f9a803afd97f4f32e4f798bb62e4b2bef5f"
Expand Down Expand Up @@ -984,55 +976,51 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==

"@playkit-js/kaltura-player-js@latest":
version "3.14.2"
resolved "https://registry.yarnpkg.com/@playkit-js/kaltura-player-js/-/kaltura-player-js-3.14.2.tgz#54804f2d6fa85fa690e7e0b2eb4bba21a864950e"
integrity sha512-Ie4uk0kmXV3vI4KOInfv0s7HFsUxtS/49Fk3rBnMsvGTntkCNQt+GOWlXt9MCUYRGNOQQGWtkRzQD/mLB07Vzg==
dependencies:
"@babel/polyfill" "^7.0.0"
"@playkit-js/playkit-js" "0.82.1"
"@playkit-js/playkit-js-dash" "1.34.0"
"@playkit-js/playkit-js-hls" "1.32.2"
"@playkit-js/playkit-js-providers" "2.39.2"
"@playkit-js/playkit-js-ui" "0.77.0"
"@types/preact-i18n" "^2.3.1"
hls.js "1.3.5"
intersection-observer "^0.12.0"
proxy-polyfill "^0.3.0"
shaka-player "4.3.5"

"@playkit-js/playkit-js-dash@1.34.0":
version "1.34.0"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-dash/-/playkit-js-dash-1.34.0.tgz#a4e31d68420a8c80ebb973dc69ab423794c73b4d"
integrity sha512-hQmGYssn/nIr1/UMMhFGCaKv1vqBLl0G22Ba5Z9frzcj8anpE/0v98MLpRbnPdkazeGg6jkGKFmBbt+BMY6zhQ==

"@playkit-js/playkit-js-hls@1.32.2":
version "1.32.2"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-hls/-/playkit-js-hls-1.32.2.tgz#ee9e17888d0764c7728064127d1588ccf3eff854"
integrity sha512-9xc9Vl1eoMlZTpEhNH/lVg66u56zG+J2jBSsFXVDiSvTv5Qgs7t8RiB04QEl9PF9b2VFh8ANbvoCbIdd3HnYjQ==

"@playkit-js/playkit-js-providers@2.39.2":
version "2.39.2"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-providers/-/playkit-js-providers-2.39.2.tgz#b00b611c2094d7b9024ba0477e412d6c064354e3"
integrity sha512-BdM9qGhe1EAzBgQPHwlqhgwiGFAiOe4yPmuCVjRsgXm+fWNJAYJAUmzujfwatvGAkXUG/MH4gbWdZyL/Qo1yUg==

"@playkit-js/playkit-js-ui@0.77.0":
version "0.77.0"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-ui/-/playkit-js-ui-0.77.0.tgz#e6e9b1533cc60496a9271dca163118e56b561647"
integrity sha512-gmFzjsiU3PSMEf63T8qlio2U4MjZpHtU9pd9YHM2YqgZXTK+KOVxhv6nCOjVCgC1otQa9McW/tlEkbG/MiTL8g==
dependencies:
preact "^10.3.4"
preact-i18n "^2.0.0-preactx.2"
react-redux "^7.2.0"
redux "^4.0.5"

"@playkit-js/playkit-js@0.82.1":
version "0.82.1"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js/-/playkit-js-0.82.1.tgz#3e821ac5eb979eaefa9a72bf85c792fb39796a12"
integrity sha512-b+BRGkGwXgrhfKMwwtu1vPfpLVIUxb+w8GHgpGd0cx16quF96vMF51pDz1bvFdlb49i/WWynmnxehhQX5JhJUw==
"@playkit-js/kaltura-player-js@3.17.13-canary.0-0eb945c":
version "3.17.13-canary.0-0eb945c"
resolved "https://registry.yarnpkg.com/@playkit-js/kaltura-player-js/-/kaltura-player-js-3.17.13-canary.0-0eb945c.tgz#5d7ef2f462a415568252af23afead6f44652aa3f"
integrity sha512-MqpfKDHWFhDjia20Lxg+U//1QNXypzlw0Bk4gm8+8xbYGAPlQYBtVMMJVoaWntSBtsoiItoiTdQ5ycMwJWWotw==
dependencies:
"@playkit-js/playkit-js" "0.84.8-canary.0-03d99c3"
"@playkit-js/playkit-js-dash" "1.37.0"
"@playkit-js/playkit-js-hls" "1.32.11"
"@playkit-js/playkit-js-providers" "2.40.4"
"@playkit-js/playkit-js-ui" "0.79.0-canary.0-52912d4"
hls.js "1.4.11"
shaka-player "4.7.0"

"@playkit-js/playkit-js-dash@1.37.0":
version "1.37.0"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-dash/-/playkit-js-dash-1.37.0.tgz#d189543f3084469061ac9a71660d0dbc3af48a01"
integrity sha512-7g28jlPJftJXQhssfhS7+uK2sb/PhgfGu5pR2GN+sk1evNhMHWHJj/utIyRqv6z5hjlLTUq50A51BWTFUL3/aQ==

"@playkit-js/playkit-js-hls@1.32.11":
version "1.32.11"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-hls/-/playkit-js-hls-1.32.11.tgz#0d4d514750a660e9899d04e97482af6311355707"
integrity sha512-YWhFAYeBpONeENRQbmm6901FtkT4vwzu8O5mzrrty7TUGR3zXpBGszul1bngAZQWS6UZ5vpuvAuLSz+37BFUpg==

"@playkit-js/playkit-js-providers@2.40.4":
version "2.40.4"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-providers/-/playkit-js-providers-2.40.4.tgz#181651986ab484c202f0f7805bc301b6e11df6d5"
integrity sha512-nnBaWjNvPcg6jRyEsuNJrKK0HWaKm46onqXV/HBesbwxJT/u/l01h3oJl7VkUB6hmZOMQuWGg3/QCdvswwQsRg==

"@playkit-js/playkit-js-ui@0.79.0-canary.0-52912d4":
version "0.79.0-canary.0-52912d4"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-ui/-/playkit-js-ui-0.79.0-canary.0-52912d4.tgz#0abe1d36c55aa7054f40d3883537f8ce42ca3702"
integrity sha512-LP9CSyHvw1WB4vK2NAYsvVdDI9+izYoYZ1hpLcNVv+bcK41/6mvhRRGBci+s19o9hpV2bRdDs0yXT2UdxaalcQ==
dependencies:
preact "10.4.6"
preact-i18n "2.0.0-preactx.2"
react-redux "7.2.1"
redux "4.0.5"

"@playkit-js/playkit-js@0.84.8-canary.0-03d99c3":
version "0.84.8-canary.0-03d99c3"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js/-/playkit-js-0.84.8-canary.0-03d99c3.tgz#2bd437baaa7da8feb7f6f9a56c5eb32985692f88"
integrity sha512-/KiwAbqA+wpJWAhDIOimNkoMBHKFi1x5ELL71B0aMkvhTLN2G7a51K8rAfZnWOwqj44IYWt3X8Z/FWfz84SkLw==
dependencies:
js-logger "^1.6.0"
ua-parser-js "1.0.2"
ua-parser-js "^1.0.36"

"@sindresorhus/is@^0.7.0":
version "0.7.0"
Expand Down Expand Up @@ -1123,13 +1111,6 @@
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==

"@types/preact-i18n@^2.3.1":
version "2.3.2"
resolved "https://registry.yarnpkg.com/@types/preact-i18n/-/preact-i18n-2.3.2.tgz#7b5a31e1c84ead424e8c6ed3d57a02487d430fc7"
integrity sha512-j1J/f9yzds7X3RP7oIO5wL+owXJyULv0qRWcX/eVGP/Ojw8SdTjXAi722vv2Iv5GtMgshVCS1QEQFJRT8/qwHQ==
dependencies:
preact "^10.0.0"

"@webassemblyjs/ast@1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"
Expand Down Expand Up @@ -2700,11 +2681,6 @@ core-js-compat@^3.6.2:
browserslist "^4.8.5"
semver "7.0.0"

core-js@^2.6.5:
version "2.6.11"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==

core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
Expand Down Expand Up @@ -4382,10 +4358,10 @@ he@1.2.0:
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==

hls.js@1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.3.5.tgz#0e8b0799ecf2feb7ba199f5e95f35ba9552e04f4"
integrity sha512-uybAvKS6uDe0MnWNEPnO0krWVr+8m2R0hJ/viql8H3MVK+itq8gGQuIYoFHL3rECkIpNH98Lw8YuuWMKZxp3Ew==
hls.js@1.4.11:
version "1.4.11"
resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.4.11.tgz#6ca2d7ab56f2725f27bb5f2e3c7982c6ec287118"
integrity sha512-rhPSUMACcIBbcUnwWnIcRgGXqJJt0xBRxvhzl99XpGHtnnLKjbczmmBmUuQueAQcbL3SdN7D5peAObR18VrhvQ==

hmac-drbg@^1.0.0:
version "1.0.1"
Expand Down Expand Up @@ -4659,11 +4635,6 @@ interpret@^1.4.0:
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==

intersection-observer@^0.12.0:
version "0.12.2"
resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.2.tgz#4a45349cc0cd91916682b1f44c28d7ec737dc375"
integrity sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==

into-stream@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6"
Expand Down Expand Up @@ -6809,19 +6780,14 @@ postcss@^7.0.14, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6:
source-map "^0.6.1"
supports-color "^6.1.0"

preact-i18n@^2.0.0-preactx.2:
preact-i18n@2.0.0-preactx.2:
version "2.0.0-preactx.2"
resolved "https://registry.yarnpkg.com/preact-i18n/-/preact-i18n-2.0.0-preactx.2.tgz#13736788bf7c677c042e640517dd1d32cef49a06"
integrity sha512-UEuiSajR+RHTaPneqqWMgC0dmT9R5IF+n8slNV5Uog533UGsncKaCeK1UyadlWKPKGHLaM5oZohGE9YF70xFnA==
dependencies:
dlv "^1.1.2"

preact@^10.0.0:
version "10.13.2"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.13.2.tgz#2c40c73d57248b57234c4ae6cd9ab9d8186ebc0a"
integrity sha512-q44QFLhOhty2Bd0Y46fnYW0gD/cbVM9dUVtNTDKPcdXSMA7jfY+Jpd6rk3GB0lcQss0z5s/6CmVP0Z/hV+g6pw==

preact@^10.3.4:
preact@10.4.6:
version "10.4.6"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.4.6.tgz#86cc43396e4bdd755726a2b4b1f0529e78067cd3"
integrity sha512-80WJfXH53yyINig5Wza/8MD9n4lMg9G6aN00ws0ptsAaY/Fu/M7xW4zICf7OLfocVltxS30wvNQ8oIbUyZS1tw==
Expand Down Expand Up @@ -6901,11 +6867,6 @@ proxy-addr@~2.0.5:
forwarded "~0.1.2"
ipaddr.js "1.9.1"

proxy-polyfill@^0.3.0:
version "0.3.2"
resolved "https://registry.yarnpkg.com/proxy-polyfill/-/proxy-polyfill-0.3.2.tgz#55f190054a3044e105d9de16e23719e1e9be0898"
integrity sha512-ENKSXOMCewnQTOyqrQXxEjIhzT6dy572mtehiItbDoIUF5Sv5UkmRUc8kowg2MFvr232Uo8rwRpNg3V5kgTKbA==

prr@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
Expand Down Expand Up @@ -7047,7 +7008,7 @@ react-is@^16.7.0, react-is@^16.8.1, react-is@^16.9.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

react-redux@^7.2.0:
react-redux@7.2.1:
version "7.2.1"
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.1.tgz#8dedf784901014db2feca1ab633864dee68ad985"
integrity sha512-T+VfD/bvgGTUA74iW9d2i5THrDQWbweXP0AVNI8tNd1Rk5ch1rnMiJkDD67ejw7YBKM4+REvcvqRuWJb7BLuEg==
Expand Down Expand Up @@ -7197,7 +7158,7 @@ redent@^3.0.0:
indent-string "^4.0.0"
strip-indent "^3.0.0"

redux@^4.0.5:
redux@4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f"
integrity sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==
Expand Down Expand Up @@ -7620,10 +7581,10 @@ sha.js@^2.4.0, sha.js@^2.4.8:
inherits "^2.0.1"
safe-buffer "^5.0.1"

shaka-player@4.3.5:
version "4.3.5"
resolved "https://registry.yarnpkg.com/shaka-player/-/shaka-player-4.3.5.tgz#304d60ad867fb7a0780b850b32a9614296b842db"
integrity sha512-WkqvHm8QHOsQ71d/qoc2Wa6Z5rBrG3Zgsc6ho9I9e8Xwa0io+MeREgqBuG0z6qoXK55sTImipFhDoERrkmDdUg==
shaka-player@4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/shaka-player/-/shaka-player-4.7.0.tgz#5bb0a60c1b7c2a8a3c2d1ff82e632c3c000219c3"
integrity sha512-utR9hKMt8GiGv7EDC8/nh8F1c4KeVGa4Wd8k6h+g2Ylks0m9//kvxvXkQnYAGJRtdql/CJC9Ur8YQ/G+kTwoiQ==
dependencies:
eme-encryption-scheme-polyfill "^2.1.1"

Expand Down Expand Up @@ -8529,10 +8490,10 @@ ua-parser-js@0.7.21:
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"
integrity sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==

ua-parser-js@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.2.tgz#e2976c34dbfb30b15d2c300b2a53eac87c57a775"
integrity sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==
ua-parser-js@^1.0.36:
version "1.0.37"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.37.tgz#b5dc7b163a5c1f0c510b08446aed4da92c46373f"
integrity sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==

uglify-js@^3.1.4, uglify-js@^3.6.0:
version "3.10.0"
Expand Down

0 comments on commit 7cda458

Please sign in to comment.