chaimPaneth / react-native-jw-media-player

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

Live stream position negative and then positive while video is paused #310

Open charlieperson opened 1 year ago

charlieperson commented 1 year ago

We have a live stream playing using react-native-jw-media-player. We are using a library called react-native-music-control for notification screen controls. This function is called when a user clicks the skip backward button in the notification screen.

Screenshot 2023-07-18 at 12 17 32 AM

We expect jwPlayer.position() to resolve to a negative number, which it does and behaves correctly while the video is playing. However, when the video is paused and a user tries to skip backwards, the position only resolves to a negative value the first time, and then it switches to a positive value the second time it is pressed (while video is still paused). This is a screenshot of a debug breakpoint after the second time it was pressed:

Screenshot 2023-07-18 at 12 55 31 AM

And then as you can see in the first picture we call jwPlayer.seekTo(new_position) after we run some calculations on the position. Here's a shot of our breakpoint for the onSeek callback and the results after the first and second click. We don't understand where/how/when this position is being set to a positive value and any/all insight would be greatly appreciated πŸ™ πŸ™ πŸ™

Screenshot 2023-07-18 at 12 49 37 AM Screenshot 2023-07-18 at 12 47 07 AM Screenshot 2023-07-18 at 12 53 12 AM

@chaimPaneth thank you very much for all of your help and great work on this wonderful library πŸ™