共用方式為


檢視 PowerPoint Live 簡報

在本文中,您會了解如何使用 Azure 通訊服務通話 SDK,在 Microsoft Teams 中實作檢視 PowerPoint Live 簡報。 使用 Azure 通訊服務通話 SDK 加入 Microsoft Teams 會議的出席者可以檢視 PowerPoint Live 簡報,並透過表情符號舉手來互動。 出席者檢視畫面會自動與 Microsoft Teams 簡報者的目前投影片保持同步。

必要條件

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。

下一步