Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Typings need updating #56

Open
jmurth1234 opened this issue Jul 4, 2024 · 1 comment
Open

[BUG] Typings need updating #56

jmurth1234 opened this issue Jul 4, 2024 · 1 comment
Labels
bug Something isn't working Groomed JWP team has reviewed the ticket and deemed it necessary native-sdk-issue Work is blocked by native SDK

Comments

@jmurth1234
Copy link

Describe the bug
The loadPlaylist method in the JWPlayer React Native SDK is using an incorrect type for its parameter. Currently, it uses PlaylistItem[], but it should be using JwPlaylistItem[]

Steps to reproduce the behavior:

  1. Open the TypeScript definitions for the JWPlayer React Native SDK
  2. Locate the loadPlaylist method definition
  3. Observe that the parameter type is PlaylistItem[] instead of JwPlaylistItem[]

Expected behavior
The loadPlaylist method should accept a parameter of type JwPlaylistItem[] when forceLegacyConfig is false or not set. When forceLegacyConfig is true, it should accept PlaylistItem[].

Screenshots / Visual evidence
N/A (This is a TypeScript definition issue, no visual evidence required)

Desktop (please complete the following information):
N/A (This is a TypeScript definition issue, not a build issue)

Device(s) affected
All devices using the TypeScript definitions for the JWPlayer React Native SDK

Additional context
The current type definitions show:

loadPlaylist(playlistItems: PlaylistItem[]): void;

It should be:

loadPlaylist(playlistItems: JwPlaylistItem[]): void;
@jmurth1234 jmurth1234 added the needs-grooming Has not been reviewed by codeowners for scope/validation label Jul 4, 2024
@Jmilham21 Jmilham21 added bug Something isn't working Groomed JWP team has reviewed the ticket and deemed it necessary and removed needs-grooming Has not been reviewed by codeowners for scope/validation labels Jul 10, 2024
@Jmilham21 Jmilham21 added the native-sdk-issue Work is blocked by native SDK label Oct 18, 2024
@Jmilham21
Copy link
Collaborator

Hi @jmurth1234 , I have some work started on this here: https://github.com/jwplayer/jwplayer-react-native/tree/improvement/typing-and-updates-for-load-playlist

I ran into an issue where the iOS json parser didn't expose a method for the equivalent of a JwPlaylistItem, and rather than write a parser from scratch, I've made an internal ticket to expose the method. This will be addressed soon, but in the meantime I've updated the typing in the linked branch, allowed for sending a playlist URL in the loadPlaylist, and added the expected support for Android. So iOS should work right now, but passing in a JwPlaylistItem[] may not load all the fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Groomed JWP team has reviewed the ticket and deemed it necessary native-sdk-issue Work is blocked by native SDK
Projects
None yet
Development

No branches or pull requests

2 participants