Ticket #1332 (closed bug: invalid)
getPosition returns incorrect value immediately after onSeek is fired
| Reported by: | zach | Owned by: | pablo |
|---|---|---|---|
| Priority: | Milestone: | Player 5.8 | |
| Component: | general | Keywords: | |
| Cc: | Forum thread: |
Description
1) Start the player playing 2) Pause the player. 3) Now, seek somewhere significantly later in the track. 4) Call getPosition immediately after seeking - the position returned is the position before the seek.
Change History
comment:2 Changed 2 years ago by pablo
- Status changed from closed to reopened
- Resolution invalid deleted
- Milestone changed from Player 5.7 to Player 5.8
It's reasonable to expect that getPosition() should accurately reflect the stream position after the onPlay() event; we should investigate to see if this is possible.
comment:3 Changed 23 months ago by pablo
- Status changed from reopened to closed
- Resolution set to invalid
It turns out, this is not easy to do without re-working the expected event flow in all media providers. In Flash mode, the PLAYING state is updated before the stream's position is calculated (which is updated immediately before a TIME event). In order to allow getPosition() to get the updated position, one would have to wait until the first TIME event after the state change to PLAYING, and the TIME event is not guaranteed to fire.

To get the requested seek offset using the onSeek event, don't use jwplayer().getPosition(). Instead, use the event.offset property to get the requested offset.