簡報模式
UniverSlidesUIPlugin 為當前簡報提供播放能力。播放按幻燈片順序依次進行,標記為跳過的幻燈片會被略過,每一步都應用解析後的切換效果。
開始播放
TypeScript
const presentation = univerAPI.getActivePresentation()if (presentation) { await univerAPI.executeCommand('slide.operation.presentation.start', { unitId: presentation.getId(), fromBeginning: true, })}傳入 fromBeginning: false 時,從當前活動的幻燈片開始播放;也可以傳入 startSlideId,指定一張可見的幻燈片作為起點。
導覽與停止
TypeScript
await univerAPI.executeCommand('slide.operation.presentation.next')await univerAPI.executeCommand('slide.operation.presentation.previous')await univerAPI.executeCommand('slide.operation.presentation.go-to-slide', { slideId: 'summary-slide',})await univerAPI.executeCommand('slide.operation.presentation.stop')在最後一張可見幻燈片上執行下一頁命令會停止播放;在首頁執行上一頁命令會返回 false。
瀏覽器行為
全屏和雙屏演示命令依賴瀏覽器 API。觀眾視窗必須在使用者手勢中直接開啟,否則會被彈窗攔截。只讀的 Slides UI 在註冊 UI 外掛並關閉編輯後,仍然可以執行演示模式。
你覺得這篇文檔如何?