opentok-layout-js
opentok-layout-js copied to clipboard
Feature request: add ability to update container dimensions on the fly when using getLayout
Currently to update containerDimensions you must call initLayoutContainer
again with all the options including the updated dimensions.
It would be good to able to call getLayout including the updated dimensions.
I'm happy to open a PR for this, what API do you think could work? Some ideas:
// Update getLayout with 2nd optional argument 'options'
const { boxes } = layout.getLayout(elementArray, options);
// options could really be the whole options object, allowing us to update any options on the fly, this could also be good for updating the ratios on the fly, I'm thinking mobile orientation change, to prefer landscapey videos to portaitey
// Just allow dimensions
const { boxes } = layout.getLayout(elementArray, dimensions);
// separate method to update options
layout.updateOptions(options);
const { boxes } = layout.getLayout(elementArray);