chaimPaneth / react-native-jw-media-player

React-Native Android/iOS bridge for JWPlayer SDK (https://www.jwplayer.com/)
MIT License
190 stars 91 forks source link

Error when default prop in track is omitted on Android #355

Closed chriszs closed 1 month ago

chriszs commented 2 months ago

Describe the bug I got a "Error while updating property 'config' of a view managed by : RNJWPlayerView" error box when running on Android that I was able to slowly narrow down to omitting a default property on a track in the config, e.g.:

          tracks: [
            {
              file: `${jwPlayerBase}strips/${id}-120.vtt`,
              label: 'thumbnails',
              // no 'default' prop
            },
          ],

It appears to be coming from on or around this line, despite default being marked optional in TypeScript. Maybe trackProp.hasKey("default") ? trackProp.getBoolean("default") : false would solve this.

To Reproduce Try to set a config with a track but with no default property, then run the app on Android.

Expected behavior Default defaults to false if not supplied, no error.

Screenshots / Visual evidence

Screenshot 2024-05-04 at 11 23 07 PM
chriszs commented 2 months ago

There may be a similar issue in sources[].default, as well as the label field in tracks and sources.