opentok-layout-js icon indicating copy to clipboard operation
opentok-layout-js copied to clipboard

Feature request: add ability to update container dimensions on the fly when using getLayout

Open maikthomas opened this issue 5 months ago • 0 comments

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);

maikthomas avatar Sep 05 '24 10:09 maikthomas