

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用媒體複寫進行 Amazon Chime SDK 會議
<a name="media-replication"></a>

您可以使用媒體複寫將主要 WebRTC 工作階段與多個複本工作階段連結，以觸及較大的受眾。每個 WebRTC 媒體工作階段都支援 250 個連線，您可以將主要工作階段複寫至多個複本工作階段。連接至複本工作階段的參與者只會收到連接至主要工作階段之簡報者的音訊和視訊。他們不知道連接到複寫工作階段的參與者，這使得媒體複寫非常適合需要隱私權的網路研討會和其他使用案例。

下圖顯示主工作階段與簡報者共用音訊和視訊之間的媒體複寫，以及參與者使用媒體的複本工作階段。

![\[在主要工作階段中共用的簡報者。\]](http://docs.aws.amazon.com/zh_tw/chime-sdk/latest/dg/images/replication-1.png)


**注意**  
服務配額 *Chime SDK Meetings - 每個主要會議的複本會議*的預設值為 4，您可以提高請求限制。如需配額的詳細資訊，請參閱 *AWS 一般參考*中的[AWS 服務配額](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)。

**Topics**
+ [互動式參與者](#interactive-participants)
+ [全球參與者](#global-participants)
+ [工作階段生命週期](#session-lifecycle)

## 互動式參與者
<a name="interactive-participants"></a>

連接到複本工作階段的參與者可以獲得加入主要工作階段的存取權。由於每個人都使用 WebRTC 連線，因此簡報者和參與者不會經歷轉碼延遲。當參與者在主要和複寫工作階段之間切換時，他們會重複使用其 WebRTC 連線，因此切換速度非常快。這可讓參與者對即時對話做出貢獻，而不會遺漏任何內容。

下圖顯示使用其 WebRTC 連線切換到主要工作階段的複本工作階段參與者。

![\[圖表顯示兩個參與者從複本會議切換到主要會議。\]](http://docs.aws.amazon.com/zh_tw/chime-sdk/latest/dg/images/replication-2.png)


## 全球參與者
<a name="global-participants"></a>

您可以為每個 WebRTC 媒體工作階段選擇 AWS 區域。這可讓您在比主要工作階段的區域更接近參與者的區域中建立複本工作階段。當您這樣做時，媒體會從主要工作階段流向整個 AWS 網路的複本工作階段，然後從複本工作階段流向網際網路的參與者。向全球受眾展示時，在參與者附近擁有複本工作階段有助於確保媒體在 AWS 網路而非網際網路上周遊世界，以獲得更好的會議體驗。

下圖顯示不同區域中的主要工作階段和複寫工作階段。

![\[圖表顯示 3 個區域中觀看簡報的參與者。\]](http://docs.aws.amazon.com/zh_tw/chime-sdk/latest/dg/images/replication-3.png)


## 工作階段生命週期
<a name="session-lifecycle"></a>

建立工作階段  
您可以使用 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_CreateMeeting.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_CreateMeeting.html)或 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_CreateMeetingWithAttendees.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_CreateMeetingWithAttendees.html) APIs來建立 WebRTC 媒體工作階段。根據預設，除非您特別建立複本工作階段，否則 APIs會建立主要工作階段。  
您可以透過在 `CreateMeeting`或 `CreateMeetingWithAttendees` API 呼叫`PrimaryMeetingId`中將主要工作階段`MeetingId`的 指定為 來建立複本工作階段。  
如果您將複本工作階段`MeetingId`的 指定為 `PrimaryMeetingId`，則 API 呼叫將會失敗。

建立出席者  
 若要建立加入 WebRTC 媒體工作階段所需的出席者憑證，您可以使用 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_CreateMeetingWithAttendees.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_CreateMeetingWithAttendees.html)、 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_BatchCreateAttendee.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_BatchCreateAttendee.html)或 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_CreateAttendee.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_CreateAttendee.html) APIs。  
為大量出席者建立工作階段時，請使用 `CreateMeetingWithAttendees`或 `BatchCreateAttendee`將所需的 API 呼叫數量降至最低。

刪除出席者  
您可以使用 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_DeleteAttendee.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_DeleteAttendee.html) API 來撤銷出席者的 WebRTC 媒體工作階段憑證。如果出席者已連線至工作階段，他們將中斷連線，且無法重新加入。  
當您使用 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_DeleteMeeting.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_DeleteMeeting.html) API 刪除 WebRTC 媒體工作階段時，API 會自動刪除所有出席者，而且您不需要呼叫 `DeleteAttendee`。

切換工作階段  
若要允許參與者從複本工作階段切換到主要工作階段，您必須在主要會議中為其建立登入資料。請參閱在此清單中稍早*建立出席者*。在 Amazon Chime SDK 用戶端程式庫中使用 登入資料與 `promoteToPrimaryMeeting`方法，以切換至主要工作階段。  
若要將參與者切換回複本工作階段，請使用 Amazon Chime SDK 用戶端程式庫中的 `demoteFromPrimaryMeeting`方法，或使用 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_DeleteAttendee.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_DeleteAttendee.html) API 使主要工作階段憑證失效。  
直接連接到主要工作階段的簡報者無法切換到複本工作階段。
如需在工作階段之間切換的詳細資訊，請參閱用戶端程式庫文件：  
+ GitHub 上的 [Amazon Chime SDK for Android](https://github.com/aws/amazon-chime-sdk-android)。
+ GitHub 上的[適用於 iOS 的 Amazon Chime SDK](https://github.com/aws/amazon-chime-sdk-ios)。
+ GitHub 上[適用於 JavaScript 的 Amazon Chime SDK 用戶端程式](https://github.com/aws/amazon-chime-sdk-js)庫。

刪除工作階段  
您可以使用 [https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_DeleteMeeting.html](https://docs.aws.amazon.com/chime/latest/APIReference/API_meeting-chime_DeleteMeeting.html) API 來刪除 WebRTC 媒體工作階段。  
如果您刪除主要工作階段，`DeleteMeeting`API 會自動刪除所有連接的複本工作階段。因此，若要刪除所有工作階段，只要刪除主要工作階段即可。  
如果連續 5 分鐘沒有出席者連線，服務會自動刪除主要工作階段。服務只會在刪除主要工作階段時自動刪除複本工作階段。這表示您可以在建立主要工作階段時建立複本工作階段，而複本將在主要工作階段期間可用。