bitmovin / bitmovin-player-ui

The Bitmovin Adaptive Streaming Player UI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable seeking to exact clicked position within timeline markers

opened this issue · comments

Is it possible to enable clicking within a marker and seek to the exact clicked position – i.e. as it would if there were no markers? What seems to happen by default is that it seeks to the starting marker. I had a look at seekbar.ts and uiconfig.ts, but I was not able to find any timeline marker click events.

Hi, there is currently no config option to disable the marker snapping behavior, but you can find the code that handles it here:

let snappedMarker = this.getMarkerAtPosition(percentage);
let seekPositionPercentage = percentage;
if (snappedMarker) {
if (snappedMarker.duration > 0) {
if (percentage < snappedMarker.position) {
// Snap the position to the start of the interval if the seek is within the left snap margin
// We know that we are within a snap margin when we are outside the marker interval but still
// have a snappedMarker
seekPositionPercentage = snappedMarker.position;
} else if (percentage > snappedMarker.position + snappedMarker.duration) {
// Snap the position to the end of the interval if the seek is within the right snap margin
seekPositionPercentage = snappedMarker.position + snappedMarker.duration;
}
} else {
// Position markers always snap to their marker position
seekPositionPercentage = snappedMarker.position;
}
}

Thanks for the quick reply. I’ll see if I can figure it out.