Skip to content

Commit

Permalink
Adjust marker display on UI when end > canvas duration
Browse files Browse the repository at this point in the history
  • Loading branch information
Dananji committed Apr 9, 2024
1 parent 0f4dc74 commit ee1c513
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/MediaPlayer/VideoJS/VideoJSPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,12 @@ function VideoJSPlayer({
type: 'setTimeFragment',
});
if (start != end) {
// Set the end to canvas duration if it's greater for marker rendering
let markerEnd = end > canvasDuration ? canvasDuration : end;
player.markers.add([
{
time: start,
duration: end - start,
duration: markerEnd - start,
text: currentNavItem.label,
},
]);
Expand Down

0 comments on commit ee1c513

Please sign in to comment.