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

Function progessTimeline

src/lib/createAndHandleSegments.ts:33–46  ·  view source on GitHub ↗
(segments: Segment[], player: any)

Source from the content-addressed store, hash-verified

31 return percent;
32}
33function progessTimeline(segments: Segment[], player: any) {
34 const progressEles: NodeListOf<HTMLDivElement> = document.querySelectorAll(
35 '.timeline-segments-progress',
36 );
37
38 segments.forEach((each: Segment, index: number) => {
39 if (each?.end > player?.currentTime()) {
40 progressEles[index].style.right =
41 `${((each?.end - player?.currentTime()) / (each?.end - each?.start)) * 100}%`;
42 } else {
43 progressEles[index].style.right = '0px';
44 }
45 });
46}
47
48function previewViaMouseOverOrMove(e: any) {
49 const timelineContainer = document?.querySelector('#timeline-container');

Callers 1

updateTimelineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected