簡報模式
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 外掛程式並關閉編輯,也可以執行簡報模式。
你覺得這篇文檔如何?