<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 一類消息 - [WsMessage](#ws_message) - [Cmd](#cmd) - [Signal](#signal) ### Cmd <a id="cmd"></a> ```javascript { type: "cmd", hash: "", key: "" // show_control_panel_from_native // lesson_begin // ppt_finish } ``` ### Signal <a id="signal"></a> `Signal`消息白板不作處理,接受的消息轉發到客戶端,提供發送接口供客戶端調用。 ```javascript { type: "signal", hash: "", payload: "" } ``` ### WsMessage <a id="ws_message"></a> ```javscript { hash: string, // 消息的唯一標識 key: string, // message的名稱 pageIndex: number, // 消息所屬的課件頁碼 // 消息體 extra: string, stime: string, time: number, [message]<T: IMessage>: T // 其他的消息類 } ``` **IMessage**的類型: - [KeyFrameMessage](#keyframe) - [BroadcastMessage](#broadcast) - [Connection](#connection) - TemplateMessage - [MediaMessage](#media) - [SyncMediaMessage](#media) - AnimationMessage - SyncObjectMessage 未使用 - PluginMessage 未使用 #### KeyFrameMessage <a id="keyframe"></a> 記錄所有的消息,用于同步當前白板狀態(中途進入教室、回放),白板客戶端僅接受不發出(白板初始化時會發出一個空的`KeyFrame`消息用以請求當前的白板狀態)。 ```javascript { hash: "", key: "keyframe", pageIndex: 0, keyframe: { currentKeyFrame: string // 壓縮過的 } } ``` ### BroadcastMessage <a id="broadcast"></a> 所有工具面板產生的消息。 ```javascript { hash: "", key: "broadcast", broadcast: { hashKey: string, action: string, cid: string, owner: string, pageName: string, // 所在課件頁的名字/頁碼 toolName: string, // 面板工具的名字 type: string, data: string, // JSON.Stringify targetCid: string, mode: number } } ``` #### 消息觸發者: - 激光筆 ```javascript // 選中激光筆 { hashKey: "", action: "pointer-start", data: {x: 0, y: 0} // 或者為上次激光筆最后的坐標 } // 移動激光筆 { hashKey: "", action: "pointer-move", data: {x: 0, y: 0} // 100ms發送一次,為觸發時最后的坐標 } // 選中其他工具(取消選中激光筆) { hashKey: "", action: "pointer-end" } ``` - 畫筆 ```javascript // 鼠標按下 { hashKey: "", cid: "", key: "broadcast", type: "component.ToolEvent.tool_update", toolName: "Component.Graphics", owner: "", // 當前用戶ID mode: 10, // 筆畫類型:曲線、直線等 pageName: "", // 當前課件頁名稱 action: "Component.ToolEvent.Actions.start", data: "" // color、thickness、startX、startY } // 鼠標移動 { hashKey: "", cid: "", key: "broadcast", type: "component.ToolEvent.tool_update", toolName: "Component.Graphics", owner: "", // 當前用戶ID mode: 10, // 筆畫類型:曲線、直線等 pageName: "", // 當前課件頁名稱 action: "Component.ToolEvent.Actions.updating", data: "" // {x, y} or [[x, y], ...] } // 鼠標抬起 { hashKey: "", cid: "", key: "broadcast", type: "component.ToolEvent.tool_update", toolName: "Component.Graphics", owner: "", // 當前用戶ID mode: null, // 筆畫類型:曲線、直線等 pageName: "", // 當前課件頁名稱 action: "Component.ToolEvent.Actions.end", data: "" // 之前的mode } ``` - 文本 ```javascript // 鼠標按下 插入光標 { hashKey: "", cid: "", key: "broadcast", type: "component.ToolEvent.tool_update", toolName: "Component.TextInput", owner: "", // 當前用戶ID mode: null, pageName: "", // 當前課件頁名稱 action: "Component.ToolEvent.Actions.start", data: "" // fontSize、textColor、x、y } // 輸入 { hashKey: "", cid: "", key: "broadcast", type: "component.ToolEvent.tool_update", toolName: "Component.TextInput", owner: "", // 當前用戶ID mode: null, pageName: "", // 當前課件頁名稱 action: "Component.ToolEvent.Actions.updating", data: "" // text、width // width 為字體所占寬度和最大寬度中較小的一個,防止文本超出課件范圍 } // 選中其他工具 { hashKey: "", cid: "", key: "broadcast", type: "component.ToolEvent.tool_update", toolName: "Component.TextInput", owner: "", // 當前用戶ID mode: null, pageName: "", // 當前課件頁名稱 action: "Component.ToolEvent.Actions.end", data: null } ``` - 撤銷 ```javascript { hashKey: "", key: "broadcst", pageName: "", targetCid: "", // 針對哪一個動作撤銷 toolName: "undo", type: "Control.once_do" } ``` - 刪除 ```javascript { hashKey: "", key: "broadcst", pageName: "", toolName: "clear", type: "Control.once_do" } ``` - 放大鏡 ```javascript // 放大、縮小、重置 { hashKey: "", action: "zoom", data: "" // 縮放倍數 } // 放大情況下移動 { hashKey: "", action: "zoom-move", data: "" // {x, y} 中心點相對于舞臺的坐標 } ``` - 白板(草稿) ```javascript // 顯示、隱藏草稿 { hashKey: "", action: "Draft.Enable" | "Draft.Disable" } ``` - 翻頁 ```javascript { hashKey: "", key: "broadcast", pageName: "", // 新一頁的名稱 type: "Component.FlipEvent.pageChange" } ``` ### MediaMessage & SyncMediaMessage <a id="media"></a> 視頻相關事件。包括視頻選擇面板中選中的視頻和課件內嵌的視頻。 其中,`SyncMediaMessage`用于表示當前視頻的狀態,一般在學生端一個媒體類型的課件初始化時,會發送一個空的`SyncMediaMessage`,服務端返回當時的課件狀態用以同步,和`KeyFrame`用法類似。 ```javascript // MediaMessage { hash: "", key: "media", pageIndex: 0, media: { objectId: string, // 視頻ID payload: string, // 進度、音量等 state: number // 0-開始 1-暫停 2-停止(關閉視頻插件) 3-重置 4-跳轉進度 5-播放完成(回放) 6-音量 } } // SyncMediaMessage { hash: "", key: "syncMedia", pageIndex: 0, syncMedia: { objectId: string, // 視頻ID paused: boolean, // 是否暫停 position: number, // 播放進度 volume: number // 音量大小 }} } ``` ### Connection <a id="connection"></a> 每當服務端一個新的socket鏈接創建,或者一個連接斷開,向班級里所有的連接廣播一個`Connection`消息。 ```javascript { hash: "", key: "connection", connection: { identity: "", // 身份 state: 0, // 0-連接 1-斷開 userId: "" } } ``` ### 其他Message - StartTime 白板初始化時會發送一個空的StartTime消息,來請求本節課開始的時長等信息。 ```javascript { key: "startTime", stime: string, // 服務器時間 time: number // 本節課進行時長 -1表示未開始 } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看