mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-09 17:08:58 -05:00
fix: Chapters: If adding a chapter between two existing chapters, the order of the chapters are wrong in the editor timeline, and in the player chapter view
This commit is contained in:
parent
f67021b17b
commit
e06115b8ee
@ -1878,7 +1878,9 @@ const TimelineControls = ({
|
||||
|
||||
// Render the clip segments on the timeline
|
||||
const renderClipSegments = () => {
|
||||
return clipSegments.map((segment, index) => {
|
||||
// Sort segments by start time to ensure correct chronological order
|
||||
const sortedSegments = [...clipSegments].sort((a, b) => a.startTime - b.startTime);
|
||||
return sortedSegments.map((segment, index) => {
|
||||
const startPercent = (segment.startTime / duration) * 100;
|
||||
const widthPercent = ((segment.endTime - segment.startTime) / duration) * 100;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user