cordova-plugin-opentok icon indicating copy to clipboard operation
cordova-plugin-opentok copied to clipboard

Video location/size does not account for viewport scaling

Open dested opened this issue 9 years ago • 1 comments

I am building an ionic/cordova app that utilizes viewport scaling, and my video is not appearing in the correct location on the screen. After modifying the openTok.js to calculate based on the window.devicePixelRatio it is pixel perfect. The following code needs to be modified in OTHelpers.coffee

~getPosition~
  return {
    top:(curtop + marginTop)*window.devicePixelRatio
    left:(curleft + marginLeft)*window.devicePixelRatio
    width:(width - (marginLeft + marginRight))*window.devicePixelRatio
    height:(height - (marginTop + marginBottom))*window.devicePixelRatio
  }

I will try to make a pull request, but if this is immediately burning anyone, this seems to be the solution.

dested avatar Sep 30 '15 22:09 dested

This did not work for me, because also the surrounding DIVs became too large. I managed to fix the video size somehow by adding the device pixel ratio in the Cordova exec command. But it still looks quirky, the borders are not set correctly. And it only works on Android, on iOS the video is somewhere it definitely does not belong.

BTW: This is for the local video stream. Do you happen to know how I can position the remote video stream that is opened when the session has started? In my case, this video is placed very strangely.

derwaldgeist avatar Oct 20 '15 08:10 derwaldgeist