Setting the initial position and dimensions of a video

When you publish a video, you can specify the DOM element (or its ID) that the publisher will replace. You can also specify the initial width and height of the publisher:

You can also set the insertMode property of the options you pass into the OT.initPublisher() method to 'append' to have the publisher appended as a child of the DOM element (container) you specify:

Similarly, when you subscribe to a stream, you can specify the target DOM element (or its ID). You can also specify the initial width and height of the subscriber:

You can also specify the initial width and height of as a percentage of the size of the parent DOM element:

If you do not specify a replace element ID (or set it to null), the application appends a new DOM element to the HTML body. The default width is 264 pixels, and the default height is 198 pixels.

If you want to apply multiple CSS rules, apply it to the parent (container) DOM element:

To apply a different size to a video on a mobile device, use CSS media queries:

If you will want to dynamically resize the video, set the insertMode to 'append' and set the height and width to '100%'.

See the next section for information on resizing or repositioning a publisher or subscriber video.