capture.stop()
停止摄像头或麦克风流,释放底层设备,并使句柄立即失效。重复停止幂等。
Syntax
await host.capture.stop(handle);
Examples
stopButton.onclick = async () => {
await host.capture.stop(camera);
camera = null;
};
Errors
其他应用或错误资源类型的句柄返回 resource-denied/stale-handle;已经停止的同一句柄不报错。
Requirements
- 能力:
host:capture.stop - 用户激活:不需要
- 信任档位:yellow