-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add duration to metadata #1048
Add duration to metadata #1048
Conversation
This should fix elan-ev#738
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.
One code style and one semantic thingy.
const start = new Date(); | ||
const end = new Date(start.getTime() + duration * 1000); |
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.
This would set the start point to the upload time and the end point to that plus duration, which is not accurate. It would already be better if we would use now
as end point and now - duration
as start point. But there can still be an arbitrary amount of time between stopping the recording and actually uploading.
It would be better to store the time of when the recording was stopped. And then subtract the duration from that to get the start point.
Interesting bit: due to the fact that the recording can be paused, end - recording_duration
is not necessarily the recording start point. So we have the choice between three options:
- Use the correct start/end points. Pausing means that
end - start
does NOT equal the video duration. - Use correct end point and duration, with start point being wrong if the recording was paused.
- Use correct start point and duration, with end point being wrong if the recording was paused.
I personally don't care which of these options we choose. But maybe Opencast will break if we take the first option?
(Oh, I just saw Lars mentioned this solution in the original issue. I would probably still say we should use the correct recording stop time.)
|
||
useEffect(() => { | ||
if (fullDuration !== undefined) { | ||
dispatch({ type: 'SET_DURATION', value: calcDuration(fullDuration, start, end) }); |
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.
dispatch({ type: 'SET_DURATION', value: calcDuration(fullDuration, start, end) }); | |
dispatch({ | |
type: 'SET_DURATION', | |
value: (end ?? fullDuration) - (start ?? 0), | |
}); |
This should do the same, and this way we can avoid the extra function.
This pull request has conflicts ☹ |
Replaced by the rebased version: #1077 |
This should fix #738