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

Only check element clientWidth on window resize #1613

Merged
merged 5 commits into from Oct 6, 2016

Conversation

JontyUsborne
Copy link
Contributor

checkPortalSize got the clientWidth of the video element, which caused an expensive reflow and potential for dropped frames. Only get the clientWidth when the element resizes.

@TobbeEdgeware
Copy link

Does the resize event being triggered properly also for going to full-screen? If so, we may want to use it instead of periodic calls to checkVideoSize in TextTracks.js.

@JontyUsborne
Copy link
Contributor Author

Yes, the window resize event is triggered when toggling full screen so might be a better option

Copy link
Member

@LloydW93 LloydW93 left a comment

Choose a reason for hiding this comment

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

Can you replace all the one-line ifs to be in blocks?
(e.g.)

if (type == 'video') setElementSize();

to

if (type == 'video') {
    setElementSize();
}

Otherwise, lgtm.

@LloydW93 LloydW93 merged commit b6b9438 into Dash-Industry-Forum:development Oct 6, 2016
@JontyUsborne JontyUsborne deleted the checkPortalSize branch October 11, 2016 10:28
@dsparacio dsparacio added this to the v2.4.0 milestone Dec 19, 2016
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.

None yet

4 participants