ビデオのスナップショット画像を取得する
以下のコードでは、パブリッシャー・ビデオの静止画像をキャプチャして表示しています:
var imgData = publisher.getImgData();
var img = document.createElement("img");
img.setAttribute("src", "data:image/png;base64," + imgData);
// Replace with the parent DIV for the img
document.getElementById("containerId").appendChild(img);
次のコードは、加入者ビデオの静止画像をキャプチャして表示します:
var imgData = subscriber.getImgData();
var img = document.createElement("img");
img.setAttribute("src", "data:image/png;base64," + imgData);
// Replace with the parent DIV for the img
document.getElementById("containerId").appendChild(img);