betajs/betajs-media

View on GitHub

Showing 92 of 167 total issues

Function _detectCurrentDeviceId has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            _detectCurrentDeviceId: function(devices, devicesCount, isVideo) {
                var _currentDeviceTrack, _currentDeviceSettings, _counter;
                if (isVideo) {
                    _currentDeviceTrack = this._recorder._videoTrack;
                    _currentDeviceSettings = this._recorder._videoTrackSettings;
Severity: Minor
Found in src/video_recorder/video_recorder.js - About 1 hr to fix

    Function _arraySingleVideoElement has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                _arraySingleVideoElement: function(options, stream, additionalStream, videoTrack) {
                    var self = this;
                    var video = Support.bindStreamToVideo(stream);
                    additionalStream = additionalStream || false;
                    if (additionalStream) {
    Severity: Minor
    Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

      Function bindMedia has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  bindMedia: function() {
                      if (this._bound)
                          return;
                      return Support.userMedia2(this._getConstraints()).success(function(stream) {
                          if (!this._options) return;
      Severity: Minor
      Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

        Function _startPlayback has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _startPlayback: function(options, elementCallback) {
                    var playResult, timeoutId, sendOutput;
                    var muted = options.muted,
                        timeout = options.timeout,
                        playsinline = options.playsinline;
        Severity: Minor
        Found in src/video_player/player_support.js - About 1 hr to fix

          Function isBlankFrame has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  isBlankFrame: function(canvas, frame, _pixTolerance, _frameTolerance) {
                      if (typeof Array.prototype.some === "function") {
                          return !canvas.getContext('2d')
                              .getImageData(0, 0, canvas.width, canvas.height).data
                              .some(function(channel) {
          Severity: Minor
          Found in src/encoding/webm_encoder.js - About 1 hr to fix

            Function constructor has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        constructor: function(options, transitionals) {
                            inherited.constructor.call(this);
                            options = Objs.extend(Objs.clone(options || {}, 1), transitionals);
                            var sources = options.source || options.sources || [];
                            if (Types.is_string(sources))
            Severity: Minor
            Found in src/audio_player/audio_player.js - About 1 hr to fix

              Function _loadHls has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _loadHls: function(source) {
                          var promise = Promise.create();
                          var Hls = this._hlsObj();
                          this._hls = new Hls();
                          this._hls.on(Hls.Events.MEDIA_ATTACHED, function() {
              Severity: Minor
              Found in src/video_player/hls_support_mixin.js - About 1 hr to fix

                Function enumerateMediaSources has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        enumerateMediaSources: function() {
                            var promise = Promise.create();
                            var promiseCallback = function(sources) {
                                var result = {
                                    audio: {},
                Severity: Minor
                Found in src/webrtc/webrtc_support.js - About 1 hr to fix

                  Function __checkAndApplyCorrectConstraints has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              __checkAndApplyCorrectConstraints: function(videoTrack, capabilities, setConstraints) {
                                  var maxWidth = capabilities.width.max;
                                  var maxHeight = capabilities.height.max;
                  
                                  if (setConstraints.width > maxWidth || setConstraints.height > maxHeight) {
                  Severity: Minor
                  Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

                    Function errorHandler has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            errorHandler: function(err) {
                                switch (err) {
                                    case 'NotReadableError':
                                    case 'TrackStartError':
                                        return {
                    Severity: Minor
                    Found in src/webrtc/webrtc_support.js - About 1 hr to fix

                      Function constructor has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  constructor: function(options) {
                                      inherited.constructor.call(this, options);
                                      if (this._element.tagName.toLowerCase() !== "video")
                                          this._element = Dom.changeTag(this._element, "video");
                                      this._recorder = RecorderWrapper.create({
                      Severity: Minor
                      Found in src/video_recorder/video_recorder.js - About 1 hr to fix

                        Function getGlobals has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                getGlobals: function() {
                                    var getUserMedia = null;
                                    var getUserMediaCtx = null;
                        
                                    if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
                        Severity: Minor
                        Found in src/webrtc/webrtc_support.js - About 1 hr to fix

                          Function _buildVideoElementsArray has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      _buildVideoElementsArray: function(promise) {
                                          this.__multiStreamVideoSettings = {
                                              isMainStream: true,
                                              mainStream: {},
                                              smallStream: {}
                          Severity: Minor
                          Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

                            Function oncanplay has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                            video.oncanplay = function() {
                                                var s = videoTrack.getSettings();
                                                var width = this.width;
                                                var height = this.height;
                                                var aspectRatio = additionalStream ? (s.aspectRatio || (s.width / s.height)) : aspectRatio;
                            Severity: Minor
                            Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

                              Function _setLocalTrackSettings has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          _setLocalTrackSettings: function(stream) {
                                              if (typeof stream.getVideoTracks() !== 'undefined') {
                                                  if (stream.getVideoTracks()[0]) {
                                                      var self = this;
                                                      this._videoTrack = stream.getVideoTracks()[0];
                              Severity: Minor
                              Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

                                Function __compile has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            __compile: function(frames) {
                                                var totalDuration = 0;
                                                var width = null;
                                                var height = null;
                                                var clusters = [];
                                Severity: Minor
                                Found in src/webrtc/whammy_recorder.js - About 1 hr to fix

                                  Function addNewSingleStream has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              addNewSingleStream: function(device, options) {
                                                  this._initCanvasStreamSettings();
                                                  var _options, _positionX, _positionY, _height, _width, _aspectRatio, _constraints;
                                                  var _isTrueHeight = true;
                                                  _aspectRatio = this._options.video.aspectRatio;
                                  Severity: Minor
                                  Found in src/webrtc/webrtc_recorder.js - About 1 hr to fix

                                    Function promiseCallback has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                var promiseCallback = function(sources) {
                                                    var result = {
                                                        audio: {},
                                                        audioCount: 0,
                                                        video: {},
                                    Severity: Minor
                                    Found in src/webrtc/webrtc_support.js - About 1 hr to fix

                                      Function exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      module.exports = function(grunt) {
                                      
                                          var pkg = grunt.file.readJSON('package.json');
                                          var gruntHelper = require('betajs-compile');
                                          var dist = 'betajs-media';
                                      Severity: Minor
                                      Found in Gruntfile.js - About 1 hr to fix

                                        Function createSnapshotFromSource has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                                createSnapshotFromSource: function(videoSource, type, time, isUploader, h, w, x, y, quality) {
                                        Severity: Major
                                        Found in src/video_recorder/recorder_support.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language