Add an event to signal that the player was resized using the API e.g. player.dimensions()
Description
When using the API to resize the player, ie: player.dimensions(width, height), there is no event triggered to notify one that the player has been resized. This need surfaced when working on a third-party plugin that needed to be informed of the player size changing so that underlying VPAID ads could resize in response.
I propose we ad a vjs-player-resize event that is triggered when the player dimensions are changed so that developers can listen for this event to resize VPAID ads, overlays, position controls, etc. in response to the dimensions changing.
Based on previous discussion and event naming conventions it should be playerresize. And yes, we definitely need to bring it back.
Thoughts on triggering this event after fullscreenchanges as well?
@videojs/core-committers Any thoughts on this issue?
So, I think the immediate next step for this is to have player dimension methods (like width, height, dimensions) trigger a playerresize event when they're called.
I would say to add it below this line: https://github.com/videojs/video.js/blob/e187585748ac930851f02704937c7c8a87858f17/src/js/player.js#L719
Main problem with that would be that we'd get 2 playerresize if you call player.dimensions(200, 200) because each one calls dimension(), maybe that's ok and we can just fix it later.
Going to mark this as a help wanted and first timers only
I'd like to work on this issue.