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

fix #2400 issue - add configuration for browsers with bug on addCue method #2402

Closed
wants to merge 0 commits into from

Conversation

Yuvalke
Copy link
Contributor

@Yuvalke Yuvalke commented Oct 13, 2019

fix #2400 add configuration to go to the fallback structure for addCue method

Why is this Pull Request needed?

enable captions on problematic OS such as LG SDK 2

Resolves issues:

#2400

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

@@ -288,16 +288,23 @@ class TimelineController extends EventHandler {
}
// Add cues and trigger event with success true.
cues.forEach(cue => {
const addTextTrackCue = (track, cue) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This arrow function should be defined outside the forEach. Doing it here creates a new method for each cue and the function shadows the cue argument.

addTextTrackCue(currentTrack, cue);
} else {
try {
currentTrack.addCue(cue);
Copy link
Collaborator

Choose a reason for hiding this comment

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

So LG doesn't throw when calling this method? Is there a way we could test whether it works or not, and if not throw instead?

Copy link
Contributor Author

@Yuvalke Yuvalke Oct 28, 2019

Choose a reason for hiding this comment

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

Right, only on LG SDK2, it doesn't throw error when cue didn't enter to the TextTracks.cues.
It could be checked on that way..
I thought about throwing but it looks weird to me to simulate error.
we can check if it's added to TextTracks.cues by id and throw error when it doesn't, to make it similar to expected behaviour.

@Yuvalke Yuvalke closed this Oct 30, 2019
@Yuvalke Yuvalke changed the title fix #2400 issue - add configuration for browsers with bug on addCue method fix #2400 issue - cues doesn't show up on browsers which addCue doesn't throw error with invalid structure Oct 30, 2019
@Yuvalke Yuvalke changed the title fix #2400 issue - cues doesn't show up on browsers which addCue doesn't throw error with invalid structure fix #2400 issue - add configuration for browsers with bug on addCue method Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextTrack doesn't show up on LG SDK2
2 participants