diff --git a/Model/SeekType.swift b/Model/SeekType.swift index 62c021fd..8760c43e 100644 --- a/Model/SeekType.swift +++ b/Model/SeekType.swift @@ -1,6 +1,7 @@ import Foundation enum SeekType: Equatable { + case chapterSkip(String) case segmentSkip(String) case segmentRestore case userInteracted diff --git a/Shared/Player/Controls/OSD/Seek.swift b/Shared/Player/Controls/OSD/Seek.swift index f729a9a0..3bfa86b5 100644 --- a/Shared/Player/Controls/OSD/Seek.swift +++ b/Shared/Player/Controls/OSD/Seek.swift @@ -85,6 +85,14 @@ struct Seek: View { .font(.system(size: playerControlsLayout.segmentFontSize)) .foregroundColor(getColor(for: category)) .padding(.bottom, 3) + case let .chapterSkip(chapter): + Divider() + Text(chapter) + .font(.system(size: playerControlsLayout.segmentFontSize)) + .truncationMode(.tail) + .multilineTextAlignment(.center) + .foregroundColor(Color("AppRedColor")) + .padding(.bottom, 3) default: EmptyView() } diff --git a/Shared/Player/Controls/TimelineView.swift b/Shared/Player/Controls/TimelineView.swift index 81be7876..0058bc41 100644 --- a/Shared/Player/Controls/TimelineView.swift +++ b/Shared/Player/Controls/TimelineView.swift @@ -333,7 +333,7 @@ struct TimelineView: View { var chaptersLayers: some View { ForEach(chapters) { chapter in RoundedRectangle(cornerRadius: 4) - .fill(Color.orange) + .fill(Color("AppRedColor")) .frame(maxWidth: 2, maxHeight: height) .offset(x: (chapter.start * oneUnitWidth) - 1) } diff --git a/Shared/Player/Video Details/ChapterView.swift b/Shared/Player/Video Details/ChapterView.swift index 8a5fc0d2..aaad5b87 100644 --- a/Shared/Player/Video Details/ChapterView.swift +++ b/Shared/Player/Video Details/ChapterView.swift @@ -15,7 +15,7 @@ import SwiftUI var body: some View { Button(action: { - player.backend.seek(to: chapter.start, seekType: .userInteracted) + player.backend.seek(to: chapter.start, seekType: .chapterSkip(chapter.title)) }) { Group { verticalChapter @@ -72,7 +72,7 @@ import SwiftUI var body: some View { Button { - player.backend.seek(to: chapter.start, seekType: .userInteracted) + player.backend.seek(to: chapter.start, seekType: .chapterSkip(chapter.title)) } label: { Group { horizontalChapter