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.
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
Classifier: Custom Video Controls #3684
Classifier: Custom Video Controls #3684
Changes from 30 commits
838c5eb
f2e15e5
5ad95ce
2f61ab3
6d0d984
0f1feb1
d49c09e
6735ede
7be841c
9458a80
36c692a
fec8ad3
c5f371a
610c073
249a303
96f36b8
720cae4
8b9af19
d9e5729
e8cc4d6
5d62695
f8454ae
73dd3c0
49261f6
1366596
50d9211
e7d5caf
06b7480
940f707
33d0fc0
16ded41
0e32db1
6652812
afc2bfe
c8be69a
a5e3544
f6902d7
47420a0
134c203
ae7d50f
191fcad
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[documentation] Does this need to be updated to
(string) '1x', '0.5x', or '0.25x'
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally, I'll update the README.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] This probably comes down to subjective preferences, but I like storing "pure" values in states. So I'd...
playbackRate
as a number (1
) instead of a string ('1x'
)const sanitizedRate = Number(playbackRate.slice(0, -1))
string-to-number transformation intohandleSpeedChange()
insteadAgain though, this is just a matter of preference. As long as it works and mostly makes sense, it's fine. 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. At the time, I did this so the VIdeoController's speed control's labels will match that of PFE. I like your suggestion to store a pure value in state and then render a string label such as 0.5x. I'll leave it as is, and create a to-do in the Video Annotator project board to refactor while I add simple speed control buttons intended to display with the native browser video controls in non-drawing-tools projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be
current?.
, or will the existence of playerRef always ensure there's acurrent
object?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
playerRef.current
will be null when the component mounts. I think the ref will be set after the first render. Probably safe here, if this is a handler that’s called once the player DOM exists.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleSliderChange()
is used in VideoController. VideoController renders independently ofplayerRef
, so I'll addcurrent?
here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I really like that we not only explain what this component is, but also WHY it exists. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[documentation] Might be worth noting how the function is called. (See note on
onSliderChange
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[documentation] Might be worth noting how the function is called. e.g. When the slider is changed, the function will be called with func(changeEvent), where changeEvent.target.value is the time (number, in seconds) in the video that the user is scrubbing towards/seeking to go to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MDN documents change events for range inputs. Would it be helpful to link to that? I’m not sure if that’s what you’re asking @shaunanoordin? I read your comment as ‘explain how change events work.’
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I lean toward Jim's suggestion. For instance, the variable passed to
onSliderChange()
is distinctly labeled ase.target.value
in SingleVideoViewerContainer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[documentation] Might be worth noting how the function is called. (See note on
onSliderChange
)