Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenTok grab screenshot of a subscriber's video stream

I am wondering how I could grab the screenshot of a Subscriber's video feed. I see a Stream object representing the video stream is passed into the Subscriber's constructor, but I have no idea how to take advantage using it to convert current frame into Bitmap. And idea ?

Thanks in advance !

like image 248
cyc115 Avatar asked Oct 20 '22 03:10

cyc115


1 Answers

To get a base64 encoding of the subscriber image, simply call subscriber.getImgData(). Documentation for javascript library here!

If you want to capture video on iOS devices, download the SDK and look in the samples folder for Live-Photo-Capture sample app. The example uses publisher as a demo but you can follow the same reasoning to build that for subscribers.

If you want to capture subscriber on Android devices, checkout the custom video capturer in the android samples

like image 164
songz Avatar answered Oct 27 '22 19:10

songz