简体   繁体   中英

Opentok / Vonage screenshot sample for Android return solid green image

We tried the code sample provided by Opentok for capturing screenshot of publisher but it is not working. It returns solid green screen. Can some one please provide working code sample?

Can you try using the below code and let me know if you are able to take the publisher's snapshot?

(publisher?.view as TextureView).bitmap //captures publisher's snapshot

(subscriber?.view as TextureView).bitmap //captures subscriber's snapshot

To use the above, please make sure to enable textureView inside sessionOptions as below:-

session = Session.Builder(this, apiKey, sessionId).sessionOptions(object : Session.SessionOptions() {
            
            override fun useTextureViews(): Boolean {
                return true
            }
        }).build().also {
            it.setSessionListener(sessionListener)
            it.connect(token)
        }

Let me know how it goes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM