【发布时间】:2021-12-09 22:09:30
【问题描述】:
我们尝试了 Opentok 提供的code sample 来捕获发布者的屏幕截图,但它不起作用。它返回稳定的绿屏。有人可以提供工作代码示例吗?
【问题讨论】:
标签: api video screenshot opentok vonage
我们尝试了 Opentok 提供的code sample 来捕获发布者的屏幕截图,但它不起作用。它返回稳定的绿屏。有人可以提供工作代码示例吗?
【问题讨论】:
标签: api video screenshot opentok vonage
您可以尝试使用下面的代码,如果您可以拍摄发布者的快照,请告诉我?
(publisher?.view as TextureView).bitmap //captures publisher's snapshot
(subscriber?.view as TextureView).bitmap //captures subscriber's snapshot
要使用上述方法,请确保在 sessionOptions 中启用 textureView,如下所示:-
session = Session.Builder(this, apiKey, sessionId).sessionOptions(object : Session.SessionOptions() {
override fun useTextureViews(): Boolean {
return true
}
}).build().also {
it.setSessionListener(sessionListener)
it.connect(token)
}
告诉我进展如何。
【讨论】: