lib/MediaObjectCreator.js
function getConstructor(type, strict) {
  var result = register.classes[type.qualifiedType] || register.abstracts[type
      .qualifiedType] ||
    register.classes[type.type] || register.abstracts[type.type] ||
    register.classes[type] || register.abstracts[type];
  if (result) return result;

  if (type.hierarchy != undefined) {
    for (var i = 0; i <= type.hierarchy.length - 1; i++) {
      var result = register.classes[type.hierarchy[i]] || register.abstracts[
        type.hierarchy[i]];
      if (result) return result;
    };
  }
  if (strict) {
    var error = new SyntaxError("Unknown type '" + type + "'")
    error.type = type

    throw error
  }

  console.warn("Unknown type '", type, "', using MediaObject instead");
  return register.abstracts.MediaObject;
}
function getConstructor(type, strict) {
  var result = register.classes[type.qualifiedType] || register.abstracts[type
      .qualifiedType] ||
    register.classes[type.type] || register.abstracts[type.type] ||
    register.classes[type] || register.abstracts[type];
  if (result) return result;

  if (type.hierarchy != undefined) {
    for (var i = 0; i <= type.hierarchy.length - 1; i++) {
      var result = register.classes[type.hierarchy[i]] || register.abstracts[
        type.hierarchy[i]];
      if (result) return result;
    };
  }
  if (strict) {
    var error = new SyntaxError("Unknown type '" + type + "'")
    error.type = type

    throw error
  }

  console.warn("Unknown type '", type, "', using MediaObject instead");
  return register.abstracts.MediaObject;
}
function getConstructor ( type , strict ) { var result = register . classes [ type . qualifiedType ] || register . abstracts [ type . qualifiedType ] || register . classes [ type . type ] || register . abstracts [ type . type ] || register . classes [ type ] || register . abstracts [ type ] ; if ( result ) return result ; if ( type . hierarchy != undefined ) { for ( var i = 0 ; i <= type . hierarchy . length - 1 ; i ++ ) { var result = register . classes [ type . hierarchy [ i ] ] || register . abstracts [ type . hierarchy [ i ] ] ; if ( result ) return result ; } ; } if ( strict ) { var error = new SyntaxError ( "Unknown type '" + type + "'" ) error . type = type throw error } console . warn ( "Unknown type '" , type , "', using MediaObject instead" ) ; return register . abstracts . MediaObject ; }
Get the constructor for a type

If the type is not registered, use generic {module:core/abstracts.MediaObject}

@function module:kurentoClient~MediaObjectCreator~getConstructor

@param {external:string} type
@param {external:Boolean} strict

@return {module:core/abstracts.MediaObject}
Get the constructor for a type