The Wayback Machine - https://web.archive.org/web/20201225042659/https://github.com/clappr/clappr-plugins/pull/23
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

Closed Captions - Simplify binds on the core instance #23

Merged
merged 2 commits into from Nov 13, 2020

Conversation

@joaopaulovieira
Copy link
Member

@joaopaulovieira joaopaulovieira commented Nov 1, 2020

Summary

The delay to call bindCoreEvents when the if statement condition is not true causes the problem of not render the CC menu. This occurs because the delay used on the else statement makes some events that need to be registered with callbacks be missed.

This PR removes the unnecessary if/else statements to bind events on the core reference ASAP.

Changes

  • Move listeners on core instance to bindEvents method;
  • Delete bindCoreEvents method;

How to test

  • Play one media with subtitles;
    • E.g.: https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8
  • The CC menu should be rendered;

A picture tells a thousand words

Before this PR

Screen Shot 2020-11-01 at 14 57 49

After this PR

Screen Shot 2020-11-01 at 14 59 41

The delay to call again bindCoreEvents cause the problem because after the delay, some events are already triggered and the callbacks in the listeners are never called.
@joaopaulovieira joaopaulovieira dismissed stale reviews from jhonatangomes and leandromoreira via e378071 Nov 13, 2020
@joaopaulovieira joaopaulovieira force-pushed the fix-cc-options branch from 6e7864b to e378071 Nov 13, 2020
Copy link

@hound hound bot left a comment

Some files could not be reviewed due to errors:

�[31mERROR�[0m: Can't find config file: eslint:recommended
�[31mERROR�[0m: Can't find config file: eslint:recommended
@joaopaulovieira joaopaulovieira force-pushed the fix-cc-options branch from 979e0d4 to 4e95fe7 Nov 13, 2020
@jhonatangomes jhonatangomes merged commit bd2902f into master Nov 13, 2020
3 checks passed
3 checks passed
Hound Smells good to me. Woof!
Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
@jhonatangomes jhonatangomes deleted the fix-cc-options branch Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.