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: dimensions of CS Ad are wrong after the first pre roll. #3652

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

avelad
Copy link
Collaborator

@avelad avelad commented Sep 20, 2021

Close: #3638

@avelad
Copy link
Collaborator Author

avelad commented Sep 22, 2021

@theodab can you review it?

this.imaAdsManager_.resize(this.video_.offsetWidth,
this.video_.offsetHeight, viewMode);
});
this.resizeObserver_.observe(this.video_);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm. We should also call this.resizeObserver_.disconnect() when the ad manager is disconnected from the video, so as to not leave hanging observers.

Unfortunately, now that I am looking at it, we don't have any appropriate lifecycle events for that. AdManager.onAssetUnload is called when the player unloads, but that's not the right moment; if you unload one asset and load another, the ad manager should still be there. We'd want to call it when the player detaches instead, I think, and that isn't passed on to the ad manager.

For now, I guess I'll approve and merge this current CL. I'll make a follow-up CL to make Player.detach also dispose of the ad manager, since it's kind of outside the scope of the issue you are fixing here.

@shaka-bot
Copy link
Collaborator

All tests passed!

@theodab theodab merged commit 2bdc326 into shaka-project:master Sep 22, 2021
@avelad avelad deleted the cs-ad-dimensions branch September 23, 2021 05:09
joeyparrish pushed a commit that referenced this pull request Oct 12, 2021
joeyparrish pushed a commit that referenced this pull request Oct 12, 2021
joeyparrish pushed a commit that referenced this pull request Oct 12, 2021
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dimensions of CS Ad are wrong after the first pre roll.
3 participants