Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

jwplayer.getPosition() gives me the last played video's position


Scenario: I have 2 video's,
Step 1: I play the first video and try to get the position using jwplayer.getPosition() - everything is fine.
Step 2: When the pause the video currently playing and play the second video and try to get the position of the second video I'm getting the last video position rather than the currently playing video.

1 Community Answers

Todd

Best Answer  JW Player Support Agent  

Sounds like you are calling jwplayer().getPosition() on the wrong player by accident. Just like when you call jwplayer(‘player’).setup() you should technically give us the name of the <div>. When there is only one player on the page, you can take a shortcut and call just jwplayer().getPosition()

But with two or more players on the page, you will need to call jwplayer(‘player1’).getPosition() or jwplayer(‘player2’).getPosition() to make sure your call is talking to the correct player.

Todd

Best Answer  JW Player Support Agent  
1 rated :

Sounds like you are calling jwplayer().getPosition() on the wrong player by accident. Just like when you call jwplayer(‘player’).setup() you should technically give us the name of the <div>. When there is only one player on the page, you can take a shortcut and call just jwplayer().getPosition()

But with two or more players on the page, you will need to call jwplayer(‘player1’).getPosition() or jwplayer(‘player2’).getPosition() to make sure your call is talking to the correct player.

This question has received the maximum number of answers.