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(FEC-7266): reposition & resize captions when changing to/from full screen #155

Merged
merged 9 commits into from
Nov 1, 2017

Conversation

odedhutzler
Copy link
Contributor

@odedhutzler odedhutzler commented Oct 31, 2017

Description of the Changes

Changing the single full screen event to fire also an event when it ends (its a hack, we wait 500ms and fire the event because currently browsers does not support a "finished render full screen" event).

After the full screen event, we reposition and resize the captions.

  • adding tests.

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

Copy link
Contributor

@OrenMe OrenMe left a comment

Choose a reason for hiding this comment

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

Adding the enter/exit fullscreen semantics is not good as we don't really know(as you wrote, it's a hack)
Manage the timeout internally and don't expose it as a new event

src/player.js Outdated
}

// waiting the browser to render the screen
setTimeout(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

save timeout id and handle cases when events come in consecutive manner, e.g. debounce it.
Also, move timeout to const value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@OrenMe i didn't debounce it - just ignored previous timeouts (the last one will be the one that will be executed - i think that's the behavior we want)

src/player.js Outdated
this._repositionCuesTimeout = setTimeout(() => {
processCues(window, this._activeTextCues, this._textDisplayEl);
this._repositionCuesTimeout = false;
}, 1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just move this to a const value, REPOSITION_CUES_TIMEOUT and we are good

Copy link
Contributor

@OrenMe OrenMe left a comment

Choose a reason for hiding this comment

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

and please fix flow errors

@OrenMe OrenMe merged commit d2892b8 into master Nov 1, 2017
@OrenMe OrenMe deleted the FEC-7266 branch November 1, 2017 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants