-
Notifications
You must be signed in to change notification settings - Fork 116
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
New: timestamp unit for startAt #691
Conversation
Verified that @DanDeMicco has signed the CLA. Thanks for the pull request! |
* @return {number} - the time in seconds | ||
*/ | ||
convertTimestampToSeconds(timestamp) { | ||
let timeInSeconds = 0; |
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.
use INITIAL_TIME_IN_SECOND?
* @param {string} match - the timestamp substring e.g. 1h, 2m, or 3s | ||
* @return {number} - the number for the given unit | ||
*/ | ||
const getValueOfMatch = (match) => { |
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.
Might want to break this out for testing purposes
return Number.isNaN(parsedMatch) ? 0 : parsedMatch; | ||
}; | ||
|
||
if (hours) { |
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.
very readable! 👍
Adds support for timestamp parsing for startAt. A timestamp is a youtube style timestamp such as 5h2m1s and will start media previews at that point.