<commit_before>angular.module('videoplayer', [])
  .directive('videoplayer', function() {
    return {
      name: 'videoplayer',
      scope: {},
      controller: 'videoCtrl',
      restrict: 'E',
      template: '<video autoplay="true" width="300" height="300"></video>',
      replace: true
    };
  })
  .controller('videoCtrl', function() {
    var errorCallback = function(e) {
      console.log('Reeeejected!', e);
    };

    navigator.getUserMedia  = navigator.getUserMedia ||
                              navigator.webkitGetUserMedia ||
                              navigator.mozGetUserMedia ||
                              navigator.msGetUserMedia;

    navigator.getUserMedia({video: true, audio: true}, function(localMediaStream) {
      var video = document.querySelector('video');
      video.src = window.URL.createObjectURL(localMediaStream);

      // Note: onloadedmetadata doesn't fire in Chrome when using it with getUserMedia.
      // See crbug.com/110938.
      video.onloadedmetadata = function(e) {
        // Ready to go. Do some stuff.
      };
    }, errorCallback);
  });
<commit_msg>Added canvas to style video<commit_after>angular.module('videoplayer', [])
  .directive('videoplayer', function() {
    return {
      name: 'videoplayer',
      scope: {},
      controller: 'videoCtrl',
      restrict: 'E',
      template: '<video id="videoplayer" autoplay></video><canvas id="canvas-video-player"></canvas>',
      replace: true
    };
  })
  .controller('videoCtrl', function() {
    var successCallback =  function(localMediaStream) {
      var video = document.getElementById('videoplayer');
      video.src = window.URL.createObjectURL(localMediaStream);
      video.style = '{ position: absolute; top: 50%; left: 50%; margin: -180px 0 0 -240px; }';
      var canvas = document.getElementById('canvas-video-player');
      canvas.style = '{ position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; }';
    };
  
    var errorCallback = function(e) {
      console.log('Reeeejected!', e);
    };
  
    navigator.getUserMedia  = navigator.getUserMedia ||
                              navigator.webkitGetUserMedia ||
                              navigator.mozGetUserMedia ||
                              navigator.msGetUserMedia;

    navigator.getUserMedia({video: true, audio: true}, successCallback, errorCallback);
  });

{'fraction_non_alphanumeric': 0.13778705636743216, 'fraction_numerical': 0.014196242171189978, 'mean_word_length': 2.5601783060921246, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6473620', 'n_tokens_mistral': 716, 'n_tokens_neox': 683, 'n_words': 140}