MCPcopy Create free account
hub / github.com/code100x/cms / changeCurrentTimeOnClick

Function changeCurrentTimeOnClick

src/lib/createAndHandleSegments.ts:58–67  ·  view source on GitHub ↗
(e: any, player: any)

Source from the content-addressed store, hash-verified

56 }
57}
58function changeCurrentTimeOnClick(e: any, player: any) {
59 const timelineContainer = document.querySelector('#timeline-container');
60
61 const rect = timelineContainer && timelineContainer?.getBoundingClientRect();
62 let percent;
63 if (rect) {
64 percent = Math.min(Math.max(0, e?.x - rect?.x), rect?.width) / rect?.width;
65 player?.currentTime(percent * player?.duration());
66 }
67}
68
69function setCurrentLabel(
70 e: any,

Callers 1

updateTimelineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected