Source: node_modules/kurento-client-elements/lib/complexTypes/VideoInfo.js

/* Autogenerated with Kurento Idl */

/*
 * (C) Copyright 2013-2015 Kurento (https://kurento.openvidu.io/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

var inherits = require('inherits');

var kurentoClient = require('kurento-client');

var checkType = kurentoClient.checkType;
var ChecktypeError = checkType.ChecktypeError;

var ComplexType = require('kurento-client-core').complexTypes.ComplexType;


/**
 *
 * @constructor module:elements/complexTypes.VideoInfo
 *
 * @property {external:Boolean} isSeekable
 *  Seek is possible in video source
 * @property {external:int64} seekableInit
 *  First video position to do seek in ms
 * @property {external:int64} seekableEnd
 *  Last video position to do seek in ms
 * @property {external:int64} duration
 *  Video duration in ms
 */
function VideoInfo(videoInfoDict){
  if(!(this instanceof VideoInfo))
    return new VideoInfo(videoInfoDict)

  videoInfoDict = videoInfoDict || {}

  // Check videoInfoDict has the required fields
  // 
  // checkType('boolean', 'videoInfoDict.isSeekable', videoInfoDict.isSeekable, {required: true});
  //  
  // checkType('int64', 'videoInfoDict.seekableInit', videoInfoDict.seekableInit, {required: true});
  //  
  // checkType('int64', 'videoInfoDict.seekableEnd', videoInfoDict.seekableEnd, {required: true});
  //  
  // checkType('int64', 'videoInfoDict.duration', videoInfoDict.duration, {required: true});
  //  

  // Init parent class
  VideoInfo.super_.call(this, videoInfoDict)

  // Set object properties
  Object.defineProperties(this, {
    isSeekable: {
      writable: true,
      enumerable: true,
      value: videoInfoDict.isSeekable
    },
    seekableInit: {
      writable: true,
      enumerable: true,
      value: videoInfoDict.seekableInit
    },
    seekableEnd: {
      writable: true,
      enumerable: true,
      value: videoInfoDict.seekableEnd
    },
    duration: {
      writable: true,
      enumerable: true,
      value: videoInfoDict.duration
    }
  })
}
inherits(VideoInfo, ComplexType)

// Private identifiers to allow re-construction of the complexType on the server
// They need to be enumerable so JSON.stringify() can access to them
Object.defineProperties(VideoInfo.prototype, {
  __module__: {
    enumerable: true,
    value: "kurento"
  },
  __type__: {
    enumerable: true,
    value: "VideoInfo"
  }
})

/**
 * Checker for {@link module:elements/complexTypes.VideoInfo}
 *
 * @memberof module:elements/complexTypes
 *
 * @param {external:String} key
 * @param {module:elements/complexTypes.VideoInfo} value
 */
function checkVideoInfo(key, value)
{
  if(!(value instanceof VideoInfo))
    throw ChecktypeError(key, VideoInfo, value);
};


module.exports = VideoInfo;

VideoInfo.check = checkVideoInfo;