vjs: hide errors when updating i18n #7004

Merged
infinite-persistence merged 1 commit from ip/vjs.i18n into master 2021-09-02 18:38:58 +02:00
infinite-persistence commented 2021-09-02 10:22:51 +02:00 (Migrated from github.com)

Issue

#6989 console errors and warnings are getting out of hand!

16:07:53.259 react_devtools_backend.js:2850 VIDEOJS: ERROR: TypeError: Cannot read properties of undefined (reading 'controlText')
    at Player.resolveCtrlText (videojs.jsx?8d8d:319)
    at HTMLDivElement.data.dispatcher (video.es.js?6651:2207)
    at trigger (video.es.js?6651:2349)
    at Player.trigger$1 [as trigger] (video.es.js?6651:3277)
    at Player.handleTechLoadStart_ (video.es.js?6651:23074)
    at Player.eval (video.es.js?6651:22824)
    at HTMLVideoElement.data.dispatcher (video.es.js?6651:2207)

Notes

This method was previously criticized in 5643. But given that no better solution was submitted after a long while, nor was there a new solution for doing i18n, I'm reviving it again. It'll be no worse from the status quo.

Despite try-catch being overkill, I think the code-clarity outweighs the performance issues (if any, in the first place). Also, we are only suppressing the error in a very specialized function which even if it fails, will simply be a no-op and the GUI falling back to English.

But still open to better solutions.

## Issue #6989 console errors and warnings are getting out of hand! ``` 16:07:53.259 react_devtools_backend.js:2850 VIDEOJS: ERROR: TypeError: Cannot read properties of undefined (reading 'controlText') at Player.resolveCtrlText (videojs.jsx?8d8d:319) at HTMLDivElement.data.dispatcher (video.es.js?6651:2207) at trigger (video.es.js?6651:2349) at Player.trigger$1 [as trigger] (video.es.js?6651:3277) at Player.handleTechLoadStart_ (video.es.js?6651:23074) at Player.eval (video.es.js?6651:22824) at HTMLVideoElement.data.dispatcher (video.es.js?6651:2207) ``` ## Notes This method was previously criticized in 5643. But given that no better solution was submitted after a long while, nor was there a new solution for doing i18n, I'm reviving it again. It'll be no worse from the status quo. Despite try-catch being overkill, I think the code-clarity outweighs the performance issues (if any, in the first place). Also, we are only suppressing the error in a very specialized function which even if it fails, will simply be a no-op and the GUI falling back to English. But still open to better solutions.
tzarebczan (Migrated from github.com) reviewed 2021-09-02 10:22:51 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#7004
No description provided.