-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Marks and navigation buttons for chapters of video files in the player navigation #9924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MhhhxX
wants to merge
67
commits into
cvat-ai:develop
Choose a base branch
from
MhhhxX:chapters
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 57 commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
e1b39eb
Serializers for video chapters and integration of chapters in job and…
DE-AI f9def16
* Visualize chapter marks in the player slider component
DE-AI fe46b06
Use the start timestamp to check if the chapter is inside the segment
DE-AI 844c18e
Update openapi schema with chapter class and field.
DE-AI cfc34f9
Rest API test for chapters
DE-AI 266852b
Undo browser change for cypress
DE-AI fef0935
Extend manifest file with chapters
DE-AI 96997f9
Use manifest file as source for video chapters in the rest api.
DE-AI beb51ce
Handled Typescript code reviews.
DE-AI b1fcd5e
Move chapter marks above the player slider and bring the step dots of…
MhhhxX 661bfaf
Fix more code style issues.
MhhhxX 4b08264
Type information for get_video_chapaters method
MhhhxX 9400f93
Remove time_base field from the chapter api response as it is not nee…
MhhhxX 825b909
Ensure backwards compatibility of new "chapters" field.
MhhhxX 5b57a3b
Remove and replace deprecated imports from the typing module.
MhhhxX 5487ce7
Remove unused import
MhhhxX 2175684
Refactor find closest pts method with bisect module.
MhhhxX ae64ff7
Don't copy time base field from chapters as it isn't needed in the ap…
MhhhxX 867ae0a
Remove Fraction from the api and frontend code.
MhhhxX e80a036
Add keyboard shortcut for chapter navigations.
MhhhxX 14e184e
Add chapter menu icon.
MhhhxX 0cda387
Copy only required fields of the chapter dictionary.
MhhhxX 7752f87
Remove dev tag from api schema version.
MhhhxX 4882df9
Copy metadata and id
MhhhxX c39d982
Squashed commit of the following:
MhhhxX 3ec7e7f
Mark prop as readonly
MhhhxX 64ff04f
Merge branch 'develop' into chapters
klakhov 13b301a
Move css to class, make list scrollable
MhhhxX 6813da5
add licence header
MhhhxX d4155d6
fix imports
MhhhxX 0433cad
Replace for loop with find.
MhhhxX f9c2af4
Use reduce to collect SliderMarks, fix css style for antd slider marks
MhhhxX d8b1942
Refactored useState with redux actions.
MhhhxX 172dbbf
Make sethoveredchapter readonly
MhhhxX 53f7bc7
Add correct licence header.
ef21f69
Hide horizontal scrollbar on hover.
903d10d
Improve chapter menu icon
2a96235
Shrink chapter menu icon.
MhhhxX 94a7bb0
Merge branch 'develop' into chapters
klakhov af7af4b
Format python files
MhhhxX d137ae0
Fix eslint and stylint errors
MhhhxX b169771
Fixed get chapter for task metadata.
MhhhxX 7f03528
Make Chapter not required
MhhhxX eab4313
Use mkv instead avi because avi doesn't support chapters in the metadata
MhhhxX 865d98f
Add changelog fragment
MhhhxX 8a591fc
Fix changelog fragment
MhhhxX 86e15d6
Update schema.xml
MhhhxX 8a0e6f2
Chapters field returned by the serializer defaults to None in case of…
MhhhxX b77d5f5
Merge branch 'develop' into chapters
zhiltsov-max c99623f
Fix file name
MhhhxX 2f928b4
Merge branch 'develop' into chapters
MhhhxX fb1172f
Merge branch 'develop' into chapters
MhhhxX 11b4d90
Merge branch 'develop' into chapters
zhiltsov-max 574366a
fix shortcut test
MhhhxX 2ee857c
Add cypress tests for video chapters
MhhhxX d93047f
Merge branch 'develop' into chapters
MhhhxX f51cb21
Fix code duplication.
MhhhxX 17fae39
Use better function to check the slider value
MhhhxX 89da2bb
fix sonar issues
MhhhxX d9b6ea6
Use dom element to wait for page change.
MhhhxX 1f279ec
Add licence header
MhhhxX d00d8ad
Fix more sonar issues
MhhhxX e6d4576
Merge branch 'develop' into chapters
MhhhxX 94fb506
Move searchAcrossPages to outer scope
MhhhxX 903a469
Use correct selector to click on the correct list item
MhhhxX ac025d2
Merge branch 'develop' into chapters
MhhhxX 7a9e56c
Merge branch 'develop' into chapters
MhhhxX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ### Added | ||
|
|
||
| - Show video chapters in the player progress as marks. Seek to chapters with a menu and with player navigation buttons. | ||
| (<https://github.com/cvat-ai/cvat/pull/9924>) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
klakhov marked this conversation as resolved.
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
cvat-ui/src/components/annotation-page/top-bar/chapter-menu.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| // Copyright (C) CVAT.ai Corporation | ||
| // | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| import React from 'react'; | ||
klakhov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import Icon from '@ant-design/icons'; | ||
| import Popover from 'antd/lib/popover'; | ||
| import List from 'antd/lib/list'; | ||
| import CvatTooltip from 'components/common/cvat-tooltip'; | ||
| import { Chapter } from 'cvat-core/src/frames'; | ||
| import { ChapterMenuIcon } from 'icons'; | ||
|
|
||
| interface Props { | ||
| chapters: Chapter[]; | ||
| onSelectChapter: (id: number) => void; | ||
| onHoveredChapter?: (id: number | null) => void; | ||
| } | ||
|
|
||
| function ChapterMenu(props: Readonly<Props>): JSX.Element { | ||
| const { | ||
| chapters, | ||
| onSelectChapter, | ||
| onHoveredChapter, | ||
| } = props; | ||
|
|
||
| const content = ( | ||
| <div className='cvat-player-chapter-menu-wrapper'> | ||
| <List | ||
| className='cvat-player-chapter-menu-list' | ||
| size='small' | ||
| dataSource={chapters} | ||
| renderItem={(chapter: Chapter) => { | ||
| const itemClass = 'cvat-player-chapter-menu-list-item'; | ||
|
|
||
| return ( | ||
| <List.Item | ||
| className={itemClass} | ||
| key={chapter.id} | ||
| onClick={() => onSelectChapter(chapter.id)} | ||
| onMouseEnter={() => onHoveredChapter?.(chapter.id)} | ||
| onMouseLeave={() => onHoveredChapter?.(null)} | ||
| > | ||
| <div> | ||
| <strong> | ||
| <span style={{ color: '#aaa' }}> | ||
| {chapter.id} | ||
| {': '} | ||
| </span> | ||
| {chapter.metadata.title} | ||
| </strong> | ||
| <div> | ||
| Frames | ||
| {' '} | ||
| {chapter.start} | ||
| - | ||
| {chapter.stop} | ||
| </div> | ||
| </div> | ||
| </List.Item> | ||
|
|
||
| ); | ||
| }} | ||
| /> | ||
| </div> | ||
| ); | ||
|
|
||
| return ( | ||
| <Popover | ||
| trigger='click' | ||
| content={content} | ||
| title='Chapters' | ||
| placement='bottom' | ||
| className='cvat-player-chapter-menu' | ||
| > | ||
|
|
||
| <CvatTooltip title='Select chapter'> | ||
| <Icon | ||
| className='cvat-player-chapters-menu-button' | ||
| component={ChapterMenuIcon} | ||
| /> | ||
| </CvatTooltip> | ||
|
|
||
| </Popover> | ||
| ); | ||
| } | ||
|
|
||
| export default React.memo(ChapterMenu); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.