Files
sociology_app/uni_modules/yb-screen-capture/readme.md

23 lines
703 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# yb-screen-capture
截取当前应用窗口画面(含视频等硬件加速渲染内容),通过 base64 返回。
-**App-Android** 生效,基于 Android `PixelCopy` 实现Android 8.0 及以上能正确截取视频画面;低于 8.0 降级为 View 截图,视频区域可能为黑屏)。
- 截图范围为「当前屏幕可见区域」,不是长页面截图。
## 使用
```js
uni.captureScreen({
success: (res) => {
// res.base64 形如data:image/jpeg;base64,xxxx
console.log(res.base64)
},
fail: (err) => {
console.error(err.errCode, err.errMsg)
}
})
```
> 注意UTS 插件需要打自定义基座(标准基座无法运行)才能调试/运行。