Skip to content

Commit

Permalink
Address feedback on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
devalevenkatesh committed May 11, 2022
1 parent f944041 commit 823bff5
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions docs/classes/defaultvideotile.html
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> disconnect<wbr>Video<wbr>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Disconnect a video stream from a video element by clearing the srcObject of the video element.</p>
<p>Disconnect a video stream from a video element by setting <code>HTMLVideoElement.srcObject</code> to <code>null</code>.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -500,14 +500,14 @@ <h5>videoElement: <span class="tsd-signature-type">HTMLVideoElement</span><span
<h5>dueToPause: <span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<p>A flag to indicate whether this function is called due to pausing video tile.
Based on keepLastFrameWhenPaused, it clears out the videoElement&#39;s srcObject.</p>
Based on <code>keepLastFrameWhenPaused</code>, it sets <code>HTMLVideoElement.srcObject</code> to <code>null</code>.</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> keepLastFrameWhenPaused: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> = false</span></h5>
<div class="tsd-comment tsd-typography">
<p>If true and dueToPause is also true, then we will not clear out the srcObject of the
video element when it is paused and therefore, the last frame of the stream will be shown.</p>
<p>If <code>true</code> and <code>dueToPause</code> is also <code>true</code>, then we will not set <code>HTMLVideoElement.srcObject</code> of the
video element to <code>null</code> when it is paused and therefore, the last frame of the stream will be shown.</p>
</div>
</li>
</ul>
Expand Down
12 changes: 6 additions & 6 deletions docs/interfaces/videotilecontroller.html
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ <h3>unbind<wbr>Video<wbr>Element</h3>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Unbinds the video element from the tile if it exists for the provided tileId.
The video tile&#39;s bounded video element and that element&#39;s width and height are set to null.</p>
<p>Unbinds the video element from the tile if it exists for the provided <code>tileId</code>.
The video tile&#39;s bounded video element and that element&#39;s <code>width</code> and <code>height</code> are set to null.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -690,10 +690,10 @@ <h5>tileId: <span class="tsd-signature-type">number</span></h5>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> cleanUpVideoElement: <span class="tsd-signature-type">boolean</span></h5>
<div class="tsd-comment tsd-typography">
<p>By default, the bounded video element&#39;s srcObject is also set to null using <a href="../classes/defaultvideotile.html#disconnectvideostreamfromvideoelement">disconnectVideoStreamFromVideoElement</a>.
Pass false for cleanUpVideoElement, if you do not intend to clear the bounded video element&#39;s srcObject.
This does not remove the provided tileId mapping from the tile map in the <a href="../classes/defaultvideotilecontroller.html">DefaultVideoTileController</a>.
To remove the mapping and destroy the tile for this tileId, you can use <a href="videotilecontroller.html#removevideotile">removeVideoTile</a>.</p>
<p>By default, the bounded video element&#39;s <code>srcObject</code> is also set to null.
Pass <code>false</code> for <code>cleanUpVideoElement</code>, if you do not intend to set the bounded video element&#39;s <code>srcObject</code> to <code>null</code>.
This does not remove the provided <code>tileId</code> mapping from the tile map in the <a href="../classes/defaultvideotilecontroller.html">DefaultVideoTileController</a>.
To remove the mapping and destroy the tile for this <code>tileId</code>, you can use <a href="videotilecontroller.html#removevideotile">removeVideoTile</a>.</p>
</div>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/apioverview.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ <h3>7a. Share local video</h3>
<h3>7b. Display local and remote video</h3>
</a>
<p>You are responsible for maintaining HTMLVideoElement objects in the DOM and arranging their layout within the web page. To display a video, you must handle the <a href="https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html#videotiledidupdate">videoTileDidUpdate</a> and <a href="https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html#videotilewasremoved">videoTileWasRemoved</a> callbacks in an <a href="https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html">AudioVideoObserver</a>. In the implementation of <a href="https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html#videotiledidupdate">videoTileDidUpdate</a>, bind the tile ID from the provided VideoTileState with the HTMLVideoElement in your DOM by calling meetingSession.audioVideo.<a href="https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideofacade.html#bindvideoelement">bindVideoElement(tileId, videoElement)</a>.</p>
<p>To unbind a tile, call meetingSession.audioVideo.<a href="https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideofacade.html#unbindvideoelement">unbindVideoElement(tileId)</a>. Note that, this will also cleanup the HTML video element&#39;s <code>srcObject</code> by default. Call <code>unbindVideoElement(tileId, false)</code> to avoid the video element cleanup. Check <a href="https://github.com/aws/amazon-chime-sdk-js/pull/2217">this PR</a> description for more details.</p>
<p>To unbind a tile, call meetingSession.audioVideo.<a href="https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideofacade.html#unbindvideoelement">unbindVideoElement(tileId)</a>. Note that this will also set <code>HTMLVideoElement.srcObject</code> to <code>null</code>. Call <code>unbindVideoElement(tileId, false)</code> to avoid the video element clean up. Check <a href="https://github.com/aws/amazon-chime-sdk-js/pull/2217">this PR</a> description for more details.</p>
<p>A <code>tileId</code> is a unique identifier representing a video stream. When you stop and start, it generates a new <code>tileId</code>. You can have tileIds exceeding 25; they merely identify a particular stream uniquely. When you start video it consumes a video publishing slot, when you stop video it releases that video publishing slot. Pausing does not affect video publishing slots; it allows a remote to choose to not receive a video stream (and thus not consume bandwidth and CPU for that stream).</p>
<a href="#7c-pause-and-unpause-video-optional" id="7c-pause-and-unpause-video-optional" style="color: inherit; text-decoration: none;">
<h3>7c. Pause and unpause video (optional)</h3>
Expand Down
2 changes: 1 addition & 1 deletion guides/03_API_Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ To stop sharing video with others, call meetingSession.audioVideo.[stopLocalVide

You are responsible for maintaining HTMLVideoElement objects in the DOM and arranging their layout within the web page. To display a video, you must handle the [videoTileDidUpdate](https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html#videotiledidupdate) and [videoTileWasRemoved](https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html#videotilewasremoved) callbacks in an [AudioVideoObserver](https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html). In the implementation of [videoTileDidUpdate](https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html#videotiledidupdate), bind the tile ID from the provided VideoTileState with the HTMLVideoElement in your DOM by calling meetingSession.audioVideo.[bindVideoElement(tileId, videoElement)](https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideofacade.html#bindvideoelement).

To unbind a tile, call meetingSession.audioVideo.[unbindVideoElement(tileId)](https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideofacade.html#unbindvideoelement). Note that, this will also cleanup the HTML video element's `srcObject` by default. Call `unbindVideoElement(tileId, false)` to avoid the video element cleanup. Check [this PR](https://github.com/aws/amazon-chime-sdk-js/pull/2217) description for more details.
To unbind a tile, call meetingSession.audioVideo.[unbindVideoElement(tileId)](https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideofacade.html#unbindvideoelement). Note that this will also set `HTMLVideoElement.srcObject` to `null`. Call `unbindVideoElement(tileId, false)` to avoid the video element clean up. Check [this PR](https://github.com/aws/amazon-chime-sdk-js/pull/2217) description for more details.

A `tileId` is a unique identifier representing a video stream. When you stop and start, it generates a new `tileId`. You can have tileIds exceeding 25; they merely identify a particular stream uniquely. When you start video it consumes a video publishing slot, when you stop video it releases that video publishing slot. Pausing does not affect video publishing slots; it allows a remote to choose to not receive a video stream (and thus not consume bandwidth and CPU for that stream).

Expand Down
8 changes: 4 additions & 4 deletions src/videotile/DefaultVideoTile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export default class DefaultVideoTile implements DevicePixelRatioObserver, Video
}

/**
* Disconnect a video stream from a video element by clearing the srcObject of the video element.
* Disconnect a video stream from a video element by setting `HTMLVideoElement.srcObject` to `null`.
* @param videoElement The video element input.
* @param dueToPause A flag to indicate whether this function is called due to pausing video tile.
* Based on keepLastFrameWhenPaused, it clears out the videoElement's srcObject.
* @param keepLastFrameWhenPaused If true and dueToPause is also true, then we will not clear out the srcObject of the
* video element when it is paused and therefore, the last frame of the stream will be shown.
* Based on `keepLastFrameWhenPaused`, it sets `HTMLVideoElement.srcObject` to `null`.
* @param keepLastFrameWhenPaused If `true` and `dueToPause` is also `true`, then we will not set `HTMLVideoElement.srcObject` of the
* video element to `null` when it is paused and therefore, the last frame of the stream will be shown.
*/
static disconnectVideoStreamFromVideoElement(
videoElement: HTMLVideoElement | null,
Expand Down
12 changes: 6 additions & 6 deletions src/videotilecontroller/VideoTileController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export default interface VideoTileController {
bindVideoElement(tileId: number, videoElement: HTMLVideoElement): void;

/**
* Unbinds the video element from the tile if it exists for the provided tileId.
* The video tile's bounded video element and that element's width and height are set to null.
* @param cleanUpVideoElement By default, the bounded video element's srcObject is also set to null using [[disconnectVideoStreamFromVideoElement]].
* Pass false for cleanUpVideoElement, if you do not intend to clear the bounded video element's srcObject.
* This does not remove the provided tileId mapping from the tile map in the [[DefaultVideoTileController]].
* To remove the mapping and destroy the tile for this tileId, you can use [[removeVideoTile]].
* Unbinds the video element from the tile if it exists for the provided `tileId`.
* The video tile's bounded video element and that element's `width` and `height` are set to null.
* @param cleanUpVideoElement By default, the bounded video element's `srcObject` is also set to null.
* Pass `false` for `cleanUpVideoElement`, if you do not intend to set the bounded video element's `srcObject` to `null`.
* This does not remove the provided `tileId` mapping from the tile map in the [[DefaultVideoTileController]].
* To remove the mapping and destroy the tile for this `tileId`, you can use [[removeVideoTile]].
*/
unbindVideoElement(tileId: number, cleanUpVideoElement?: boolean): void;

Expand Down

0 comments on commit 823bff5

Please sign in to comment.