<commit_before>var exec = require('cordova/exec');

var videoElements;

document.addEventListener("touchmove", function () {
  // This function should listen for scrolling and update the position of the elements to cordova exec
  if (videoElements) {
    var video = {};
    video.localVideo = {
      x : videoElements.localVideo.getBoundingClientRect().left,
      y : videoElements.localVideo.getBoundingClientRect().top,
      width : videoElements.localVideo.offsetWidth,
      height : videoElements.localVideo.offsetHeight
    };
    video.remoteVideo = {
      x : videoElements.remoteVideo.getBoundingClientRect().left,
      y : videoElements.remoteVideo.getBoundingClientRect().top,
      width : videoElements.remoteVideo.offsetWidth,
      height : videoElements.remoteVideo.offsetHeight
    };
    // Update Video Element positioning
    exec(
      null,
      null,
      'PhoneRTCPlugin',
      'updateVideoPosition',
      [video]);
  }
});

exports.call = function (options) {
  // options should contain a video option if video is enabled
  // sets the initial video options a dom listener needs to be added to watch for movements.
  var video;
  if (options.video) {
    videoElements = {};
    video = {};
    videoElements.localVideo = options.video.localVideo;
    videoElements.remoteVideo = options.video.remoteVideo;
    var devicePixelRatio = window.devicePixelRatio || 2;
    video.localVideo = {
      devicePixelRatio: devicePixelRatio,
      // get these values by doing a lookup on the dom
      x : videoElements.localVideo.getBoundingClientRect().left,<commit_msg>phonertc.js: export updateVideoPosition for manual usage<commit_after>var exec = require('cordova/exec');

var videoElements;

exports.updateVideoPosition = function updateVideoPosition () {
  // This function should listen for scrolling and update the position of the elements to cordova exec
  if (videoElements) {
    var video = {};
    var devicePixelRatio = window.devicePixelRatio || 2;
    video.localVideo = {
      devicePixelRatio: devicePixelRatio,
      x : videoElements.localVideo.getBoundingClientRect().left,
      y : videoElements.localVideo.getBoundingClientRect().top,
      width : videoElements.localVideo.offsetWidth,
      height : videoElements.localVideo.offsetHeight
    };
    video.remoteVideo = {
      devicePixelRatio: devicePixelRatio,
      x : videoElements.remoteVideo.getBoundingClientRect().left,
      y : videoElements.remoteVideo.getBoundingClientRect().top,
      width : videoElements.remoteVideo.offsetWidth,
      height : videoElements.remoteVideo.offsetHeight
    };
    // Update Video Element positioning
    exec(
      null,
      null,
      'PhoneRTCPlugin',
      'updateVideoPosition',
      [video]);
  }
};

document.addEventListener("touchmove", exports.updateVideoPosition);

exports.call = function (options) {
  // options should contain a video option if video is enabled
  // sets the initial video options a dom listener needs to be added to watch for movements.
  var video;
  if (options.video) {
    videoElements = {};
    video = {};
    videoElements.localVideo = options.video.localVideo;
    videoElements.remoteVideo = options.video.remoteVideo;
    var devicePixelRatio = window.devicePixelRatio || 2;
    video.localVideo = {
      devicePixelRatio: devicePixelRatio,
      // get these values by doing a lookup on the dom
      x : videoElements.localVideo.getBoundingClientRect().left,
{'fraction_non_alphanumeric': 0.09156556903523974, 'fraction_numerical': 0.0008665511265164644, 'mean_word_length': 3.479948253557568, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3574165', 'n_tokens_mistral': 915, 'n_tokens_neox': 904, 'n_words': 241}