-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 TS to Cue utilities. #2202
Add TS to Cue utilities. #2202
Conversation
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.
Nice 👍
} catch (err) { | ||
// for IE11 | ||
event = document.createEvent('Event'); | ||
event.initEvent('addtrack', false, false); | ||
} | ||
event.track = track; | ||
(event as any).track = track; |
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 know this PR is specific to TS conversion, but for a future change - we might be able to use a TrackEvent
instead of Event
src/utils/output-filter.ts
Outdated
@@ -16,8 +25,8 @@ export default class OutputFilter { | |||
this.startTime = null; | |||
} | |||
|
|||
newCue (startTime, endTime, screen) { | |||
if (this.startTime === null || this.startTime > startTime) { | |||
newCue (startTime: number | null, endTime: number, screen: CaptionScreen) { |
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.
If we keep this.time
a number in the parser, we don't have to do this
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 used a sentinel value of -1 to replace where null was.
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.
Made the sentinel value a const, and export it for usage in OutputFilter now.
This removed the need to check if startTime was null.
Still need to check the (this.startTime > startTime) so that it remains the smallest value passed to it that isn't the sentinel.
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.
See comments
1ccaa4b
to
6cf7591
Compare
…be replaced with a sentinel -1 value. This simplified handling in the output filter.
My handling of the OutputFilter is wrong. Will fix in AM. |
Fixed the issue with OutputFilter. |
Addressed the comments.
This PR will...
Progress towards Typescriptifying HLS.js
Why is this Pull Request needed?
For easy dev.
Are there any points in the code the reviewer needs to double check?
CEA-608 parser review closely.
Resolves issues:
N/A, move towards #2070
Checklist