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] iOS jwplayer example - ListExample seekTo not working #106

Closed
leinnus opened this issue Dec 7, 2024 · 3 comments
Closed

[BUG] iOS jwplayer example - ListExample seekTo not working #106

leinnus opened this issue Dec 7, 2024 · 3 comments
Labels
bug Something isn't working Groomed JWP team has reviewed the ticket and deemed it necessary

Comments

@leinnus
Copy link

leinnus commented Dec 7, 2024

Describe the bug
iOS ListExample seekTo() not working

Example/app/jsx/screens/ListExample.js

  const onBeforePlay = tag => {
    tags.map(player => {
      if (player !== tag) {
        playerRef.current[player]?.pause();
      }
    });

    playerRef.current['JWPlayer-1']?.seekTo('11');
  };

package.json

  "dependencies": {
    "@jwplayer/jwplayer-react-native": "https://github.com/jwplayer/jwplayer-react-native.git",
    "@react-navigation/native": "^7.0.13",
    "@react-navigation/native-stack": "^7.1.14",
    "react": "18.3.1",
    "react-native": "0.76.4",
    "react-native-bootsplash": "^6.3.2",
    "react-native-device-info": "^14.0.1",
    "react-native-fs": "^2.20.0",
    "react-native-gesture-handler": "^2.21.2",
    "react-native-orientation-locker": "^1.7.0",
    "react-native-safe-area-context": "^5.0.0",
    "react-native-screens": "^4.3.0",
    "react-native-vector-icons": "^10.2.0",
    "rn-iphone-helper": "^2.0.4"
  },

To Reproduce
Nothing note worthy here to reproduce

Steps to reproduce the behavior:

  1. touch play icon
  2. skip to 11 sec

Expected behavior
seek to 11 sec

Screenshots / Visual evidence
image

Device(s) affected

  • Device: iPhone14
  • OS: iOS 18.1
@leinnus leinnus added the needs-grooming Has not been reviewed by codeowners for scope/validation label Dec 7, 2024
@leinnus leinnus changed the title [BUG] iOS jwplayer ListExample seekTo not working [BUG] iOS jwplayer example - ListExample seekTo not working Dec 8, 2024
@Jmilham21
Copy link
Collaborator

Hey @leinnus, the seek function expects a number, and it looks like you're providing a string:

Do:
playerRef.current['JWPlayer-1']?.seekTo(11);
Instead of:
playerRef.current['JWPlayer-1']?.seekTo('11');

When passing a Number, I was able to have the player seek the expected timestamp like in your provided snippet (thank you). You should have seen a react-native debug warning if the app/device surfaces them when attempting to pass the String. If this isn't the issue, please let me know!

@Jmilham21 Jmilham21 added invalid This doesn't seem right delivered Work has been done. Awaiting acceptance and removed needs-grooming Has not been reviewed by codeowners for scope/validation labels Dec 17, 2024
@leinnus
Copy link
Author

leinnus commented Dec 18, 2024

Not working.

playerRef.current['JWPlayer-1']?.seekTo(11);

also not working.

playerRef.current['JWPlayer-1']?.play();

Could it be the difference in react-native versions?
my react-native version is 0.76.4
example version is 0.70.14

@Jmilham21
Copy link
Collaborator

Jmilham21 commented Dec 18, 2024

@leinnus, you're correct; the issue is most likely related to your react-native version. Our library must still be prepared for production in the new architecture (bridgeless) model. I'd suggest that for now, if possible, to opt out.

I'll review what it will take for us to become usable in the new framework.

Created this Issue to look into this

@Jmilham21 Jmilham21 added bug Something isn't working Groomed JWP team has reviewed the ticket and deemed it necessary and removed invalid This doesn't seem right delivered Work has been done. Awaiting acceptance labels Dec 18, 2024
@leinnus leinnus closed this as completed Dec 19, 2024
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
Projects
None yet
Development

No branches or pull requests

2 participants