Skip to content
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

refactor: Refactor TimelineController as TypeScript #2243

Closed
wants to merge 2 commits into from
Closed

refactor: Refactor TimelineController as TypeScript #2243

wants to merge 2 commits into from

Conversation

Korilakkuma
Copy link
Contributor

@Korilakkuma Korilakkuma commented May 8, 2019

This PR will...

Refactor TimelineController as TypeScript.

Why is this Pull Request needed?

Progress towards typescripting hls.js.

Are there any points in the code the reviewer needs to double check?

No

Resolves issues:

#2070

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@itsjamie
Copy link
Collaborator

@Korilakkuma Do you have a stream where there are CEA-608 in userDataBytes to put here? Is it a common practice?

@Korilakkuma
Copy link
Contributor Author

Sorry ... I should use if like the following code.

if (data.samples[i].bytes) {
  const ccdatas = this.extractCea608Data(data.samples[i].bytes);
  this.cea608Parser.addData(data.samples[i].pts, ccdatas);
}

@johnBartos
Copy link
Collaborator

Ah, just opened this: #2250. Has a stream @itsjamie

@johnBartos
Copy link
Collaborator

@Korilakkuma I think a better solution would be to know that this data isn't 608 data - as far as I know, SEI packets do not contain 608 cues. For context, please see https://github.com/video-dev/hls.js/pull/2126/files#diff-07ec9ff0f2017ebd5cf8cdb86d568f3aR715

@Korilakkuma Korilakkuma changed the title fix: Fixed bug in the case of bytes being undefined refactor: Refactor TimelineController as TypeScript May 15, 2019
@itsjamie
Copy link
Collaborator

#2202 has types that should be used in this pull request for OutputFilter and Cues.

src/controller/timeline-controller.ts Outdated Show resolved Hide resolved
src/controller/timeline-controller.ts Outdated Show resolved Hide resolved
src/controller/timeline-controller.ts Outdated Show resolved Hide resolved
src/controller/timeline-controller.ts Show resolved Hide resolved
@stale
Copy link

stale bot commented Aug 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Copy link
Member

@michaelcunningham19 michaelcunningham19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM aside from the merge conflicts

@itsjamie could you re-review?

@@ -228,11 +240,11 @@ class TimelineController extends EventHandler {
}
}

onLevelSwitching () {
onLevelSwitching (): void {
this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is suspect of being correct for the typedef. currentLevel is typed as number, and I can't find a place where .closedCaptions is set.

Copy link
Collaborator

@itsjamie itsjamie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled this up in editor, and the suggestions tied are to fix the issues that popped up.

If the suggestions work, there will still be issues with undefined cc and start keys on the frags, but both of those are added in other PRs so we don't need to dup that work here.

Thanks @Korilakkuma!

@itsjamie
Copy link
Collaborator

Just that one last type change of number -> boolean 🎆

@stale
Copy link

stale bot commented Oct 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Oct 21, 2019
@stale stale bot closed this Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants