【问题标题】:Opentok / Vonage screenshot sample for Android return solid green image适用于 Android 的 Opentok / Vonage 屏幕截图示例返回纯绿色图像
【发布时间】:2021-12-09 22:09:30
【问题描述】:

我们尝试了 Opentok 提供的code sample 来捕获发布者的屏幕截图,但它不起作用。它返回稳定的绿屏。有人可以提供工作代码示例吗?

【问题讨论】:

    标签: api video screenshot opentok vonage


    【解决方案1】:

    您可以尝试使用下面的代码,如果您可以拍摄发布者的快照,请告诉我?

    (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)
            }
    

    告诉我进展如何。

    【讨论】:

      猜你喜欢
      • 2015-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-03
      相关资源
      最近更新 更多