本文說明如何使用 Azure 通訊服務通話 SDK,讓會議參與者在 Microsoft Teams 中檢視 PowerPoint Live 簡報 。
使用 Azure 通訊服務通話 SDK 加入 Microsoft Teams 會議的 出席者可以檢視 PowerPoint Live 簡報,並與 反應 互動並 舉手。 與會者視圖會自動與 Microsoft Teams 簡報者的目前幻燈片同步。
先決條件
- 具有有效訂閱的 Azure 帳戶。 免費建立帳戶。
- 已部署通訊服務資源。 建立通訊服務資源。
- 用於啟用呼叫客戶端的使用者存取憑證。 如需詳細資訊,請參閱建立和管理存取權杖。
- 選擇性:完成快速入門以將語音通話新增至您的應用程式。
PowerPoint Live 檢視是核心 Call API 的擴充功能。 您必須先從通話 SDK 匯入通話功能:
import { Features} from "@azure/communication-calling";
然後,您才可以從呼叫執行個體中取得功能 API 物件:
const pptLive = call.feature(SDK.Features.PPTLive);
處理簡報狀態變更
PPTLiveCallFeature透過 API 物件,您可以訂閱 isActiveChanged 事件,以處理呼叫上 PowerPoint Live 簡報狀態的變更。 Microsoft Teams 中的演示者會觸發此事件,並 isActive 指出 PowerPoint Live 是否在目前的呼叫中作用中。
pptLive.on('isActiveChanged', pptliveStateChangedHandler);
啟動和停止簡報檢視
當簡報開始時,將 target 元素新增到您的 HTML,並在簡報結束時移除它。
const pptliveStateChangedHandler = () => {
if (pptLive.isActive) {
document.getElementById('pptLiveElement').appendChild(pptLive.target);
} else {
const pptLiveElement = document.getElementById('pptLiveElement');
pptLiveElement.removeChild(pptLiveElement.lastElementChild);
}
};
停止處理簡報狀態變更
您的應用程式可以取消訂閱 isActiveChanged ,以停止接聽簡報事件。
pptLive.off('isActiveChanged', pptliveStateChangedHandler);
使用 PowerPoint Live 檢視時要知道的重要事項
- 如果任何出席者遇到檢視 PowerPoint Live 的問題,建議您切換至 螢幕共用 。
- Web 通話 SDK 支援 PowerPoint Live。
- PowerPoint Live 支援 Microsoft Teams 會議的互操作性。
- Microsoft Teams 必須用來呈現 PowerPoint Live。