-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix(PPDSC-2047): Resolve gaps in buffering seekbar by refactoring formatTrackData #206
Conversation
You can preview these changes on: |
@@ -11,26 +11,47 @@ export const formatTrackData = ( | |||
|
|||
const time = timeArr[0]; | |||
const bufferPositions = []; | |||
const closestBuffer = []; |
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.
It looks like this should just be a single value not an array?
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.
Will take a look
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'm adding a single value to an array because it enable me to use the spread operator to add the correct value to the colors array (line 48) and the values array (line 54). If the array is empty I don't need to add a ternary operator to colors or values to ensure they have the right content.
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.
Up to you. I'd prefer using a ternary operator later on but I don't feel strongly.
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've changed it
// This can occur when a user moves ahead then back again, multiple disparate buffered sections can exist. | ||
// Example here is buffered sections exist between 0-125 and 216-228. The current play position is at 32. | ||
// It has been diecided to only show the first buffer section similar to how youtube does it. |
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.
lil typo diecided
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'll sort 👍
…matTrackData (#206) * fix(PPDSC-2047): refactor formatTrackData * fix(PPDSC-2047): refactor to send closest buffer * fix(PPDSC-2047): add type to buffer array * fix(PPDSC-2047): refactor closestBuffer * fix(PPDSC-2047): fix typo
PPDSC-2047
What
I have done:
I have tested manually:
Before:
After:
Who should review this PR:
How to test: