awslabs/amazon-kinesis-video-streams-webrtc-sdk-js

Is forbidden to capture screen in default?

hkkim-openbus opened this issue · 1 comments

We try to make a service for camera monitoring and capturing a screen from Raspberry Pi device with an Android or iOS app.
I use web view in the app with sdk-js and capture the screen with Bitmap from the cache.
But it can't capture only the monitoring screen.
We found an attribute named "videoCapture" in sdk.amazonaws.com_js_aws-sdk-2.1165.0.min.js.

// sdk.amazonaws.com_js_aws-sdk-2.1165.0.min.js
// row 26 and 27
videoCapture: {type: "boolean"}

Is it forbidden in default or can I change this setting?

Hi @hkkim1021,

That videoCapture parameter doesn't belong to KVS. It belongs to AWS Device Farm: https://docs.aws.amazon.com/devicefarm/latest/APIReference/API_ExecutionConfiguration.html

Refer to the ImageCapture API for capturing images from a MediaStreamTrack: https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture

Viewer receives the video track from the master on the peerConnection track event: https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/track_event

Sample [location]

viewer.peerConnection.addEventListener('track', async event => {
  printSignalingLog('[VIEWER] Received remote track');

  await new Promise(r => setTimeout(r, 3000));
  if (event.track.kind === 'video') {
      const imageCapture = new ImageCapture(event.track);
      const bitmapImage = await imageCapture.grabFrame();
      console.log(bitmapImage.height);
      console.log(bitmapImage.width);
  }

  ...
});