Showing 92 of 167 total issues
Function _detectCurrentDeviceId
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_detectCurrentDeviceId: function(devices, devicesCount, isVideo) {
var _currentDeviceTrack, _currentDeviceSettings, _counter;
if (isVideo) {
_currentDeviceTrack = this._recorder._videoTrack;
_currentDeviceSettings = this._recorder._videoTrackSettings;
Function _arraySingleVideoElement
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_arraySingleVideoElement: function(options, stream, additionalStream, videoTrack) {
var self = this;
var video = Support.bindStreamToVideo(stream);
additionalStream = additionalStream || false;
if (additionalStream) {
Function bindMedia
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
bindMedia: function() {
if (this._bound)
return;
return Support.userMedia2(this._getConstraints()).success(function(stream) {
if (!this._options) return;
Function _startPlayback
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_startPlayback: function(options, elementCallback) {
var playResult, timeoutId, sendOutput;
var muted = options.muted,
timeout = options.timeout,
playsinline = options.playsinline;
Function isBlankFrame
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function constructor
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
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))
Function _loadHls
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_loadHls: function(source) {
var promise = Promise.create();
var Hls = this._hlsObj();
this._hls = new Hls();
this._hls.on(Hls.Events.MEDIA_ATTACHED, function() {
Function enumerateMediaSources
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
enumerateMediaSources: function() {
var promise = Promise.create();
var promiseCallback = function(sources) {
var result = {
audio: {},
Function __checkAndApplyCorrectConstraints
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
__checkAndApplyCorrectConstraints: function(videoTrack, capabilities, setConstraints) {
var maxWidth = capabilities.width.max;
var maxHeight = capabilities.height.max;
if (setConstraints.width > maxWidth || setConstraints.height > maxHeight) {
Function errorHandler
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
errorHandler: function(err) {
switch (err) {
case 'NotReadableError':
case 'TrackStartError':
return {
Function constructor
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
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({
Function getGlobals
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getGlobals: function() {
var getUserMedia = null;
var getUserMediaCtx = null;
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
Function _buildVideoElementsArray
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_buildVideoElementsArray: function(promise) {
this.__multiStreamVideoSettings = {
isMainStream: true,
mainStream: {},
smallStream: {}
Function oncanplay
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function _setLocalTrackSettings
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setLocalTrackSettings: function(stream) {
if (typeof stream.getVideoTracks() !== 'undefined') {
if (stream.getVideoTracks()[0]) {
var self = this;
this._videoTrack = stream.getVideoTracks()[0];
Function __compile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
__compile: function(frames) {
var totalDuration = 0;
var width = null;
var height = null;
var clusters = [];
Function addNewSingleStream
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addNewSingleStream: function(device, options) {
this._initCanvasStreamSettings();
var _options, _positionX, _positionY, _height, _width, _aspectRatio, _constraints;
var _isTrueHeight = true;
_aspectRatio = this._options.video.aspectRatio;
Function promiseCallback
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var promiseCallback = function(sources) {
var result = {
audio: {},
audioCount: 0,
video: {},
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
var gruntHelper = require('betajs-compile');
var dist = 'betajs-media';
Function createSnapshotFromSource
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
createSnapshotFromSource: function(videoSource, type, time, isUploader, h, w, x, y, quality) {