function validateDownload(data) {
  return new Promise(function(resolve, reject) {
    if (!data.url.length) {
      return reject({
        url: "No video url found"
      });
    }

    return resolve(new Video(data.url, data.startTime, data.xOffset));
  });
}
/**
 * validateDownload - Checks the data has at bare minimum a url then constructs
 * an {@link Video}
 *
 * @param {Object} data The data object described above
 * @return {Video} A new video object with the optional and required parameters set
 */
Checks the data has at bare minimum a url then constructs
an  Video

@param {Object} data The data object described above
@return {Video} A new video object with the optional and required parameters set
Checks the data has at bare minimum a url then constructs an Video @param { Object } data The data object described above @return { Video } A new video object with the optional and required parameters set
function validateDownload(data) {
  return new Promise(function(resolve, reject) {
    if (!data.url.length) {
      return reject({
        url: "No video url found"
      });
    }
    return resolve(new Video(data.url, data.startTime, data.xOffset));
  });
}
function validateDownload ( data ) { return new Promise ( function ( resolve , reject ) { if ( ! data . url . length ) { return reject ( { url : "No video url found" } ) ; } return resolve ( new Video ( data . url , data . startTime , data . xOffset ) ) ; } ) ; }
validateDownload - Checks the data has at bare minimum a url then constructs
 an {@link Video}
validateDownload - Checks the data has at bare minimum a url then constructs an { @link Video }