### Register preview callback and start preview example Source: https://github.com/hqw700/scrcpyoverwebrtc/blob/main/_autodocs/api-reference/useDeviceStore.md Example usage of registering a stream preview callback and sending a start_preview control command. The callback feeds NAL units to feedFrame, and the control command starts preview at 30 fps, 1080 max size, 4000000 bitrate, and stayAwake true. ```javascript deviceStore.registerPreviewCallback(deviceId, 'stream', (nalu, isKey, ptsUs) => { feedFrame(nalu, isKey, ptsUs) }) deviceStore.sendPreviewControl('start_preview', deviceId, 30, 1080, 4000000, true) ``` -------------------------------- ### WebCodecsRenderer usage example Source: https://github.com/hqw700/scrcpyoverwebrtc/blob/main/_autodocs/api-reference/WebCodecsRenderer.md Shows how to import, check support, instantiate, start, and stop the renderer. The `receiver` is expected to come from an `ontrack` event. If `start` returns `false`, fall back to HTML5 `