lib/MediaObjectCreator.js
function createMediaObject(item, callback) {
    var transaction = item.transaction;
    delete item.transaction;

    var constructor = createConstructor(item, strict);

    item = constructor.item;
    delete constructor.item;

    var params = item.params || {};
    delete item.params;

    if (params.mediaPipeline == undefined && host instanceof register.classes
      .MediaPipeline)
      params.mediaPipeline = host;

    var params_ = extend({}, params)
    item.constructorParams = checkParams(params_, constructor.constructorParams,
      item.type);

    if (Object.keys(params_)) {
      item.properties = params_;
    }

    if (!Object.keys(item.constructorParams).length)
      delete item.constructorParams;

    try {
      var mediaObject = createObject(constructor)
    } catch (error) {
      return callback(error)
    };

    Object.defineProperty(item, 'object', {
      value: mediaObject
    });

    encodeCreate(transaction, item, callback);

    return mediaObject
  }
function createMediaObject(item, callback) {
    var transaction = item.transaction;
    delete item.transaction;

    var constructor = createConstructor(item, strict);

    item = constructor.item;
    delete constructor.item;

    var params = item.params || {};
    delete item.params;

    if (params.mediaPipeline == undefined && host instanceof register.classes
      .MediaPipeline)
      params.mediaPipeline = host;

    var params_ = extend({}, params)
    item.constructorParams = checkParams(params_, constructor.constructorParams,
      item.type);

    if (Object.keys(params_)) {
      item.properties = params_;
    }

    if (!Object.keys(item.constructorParams).length)
      delete item.constructorParams;

    try {
      var mediaObject = createObject(constructor)
    } catch (error) {
      return callback(error)
    };

    Object.defineProperty(item, 'object', {
      value: mediaObject
    });

    encodeCreate(transaction, item, callback);

    return mediaObject
  }
function createMediaObject ( item , callback ) { var transaction = item . transaction ; delete item . transaction ; var constructor = createConstructor ( item , strict ) ; item = constructor . item ; delete constructor . item ; var params = item . params || { } ; delete item . params ; if ( params . mediaPipeline == undefined && host instanceof register . classes . MediaPipeline ) params . mediaPipeline = host ; var params_ = extend ( { } , params ) item . constructorParams = checkParams ( params_ , constructor . constructorParams , item . type ) ; if ( Object . keys ( params_ ) ) { item . properties = params_ ; } if ( ! Object . keys ( item . constructorParams ) . length ) delete item . constructorParams ; try { var mediaObject = createObject ( constructor ) } catch ( error ) { return callback ( error ) } ; Object . defineProperty ( item , 'object' , { value : mediaObject } ) ; encodeCreate ( transaction , item , callback ) ; return mediaObject }
Request to the server to create a new MediaElement

@param item
@param {module:kurentoClient~MediaObjectCreator~createMediaObjectCallback} [callback]
Request to the server to create a new MediaElement