-
Notifications
You must be signed in to change notification settings - Fork 35
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
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.
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(() => { |
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.
save timeout id and handle cases when events come in consecutive manner, e.g. debounce it.
Also, move timeout to const value.
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.
@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); |
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.
Just move this to a const value, REPOSITION_CUES_TIMEOUT and we are good
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.
and please fix flow errors
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.
CheckLists