Reference Source Test

src/video/video.js

  1. /*!
  2. * Mux Video
  3. * Copyright(c) 2018 Mux Inc.
  4. */
  5.  
  6. const Assets = require('./resources/assets');
  7. const Base = require('../base');
  8. const LiveStreams = require('./resources/liveStreams');
  9. const PlaybackIds = require('./resources/playbackIds');
  10. const Uploads = require('./resources/uploads');
  11. const SigningKeys = require('./resources/signingKeys');
  12. const DeliveryUsage = require('./resources/deliveryUsage');
  13.  
  14. /**
  15. * @ignore
  16. * @extends Base
  17. * Video Class - Provides access to the Mux Video API
  18. *
  19. * @example
  20. * const muxClient = new Mux(accessToken, secret);
  21. * const { Video } = muxClient;
  22. *
  23. * // Create an asset
  24. * Video.Assets.create({input: 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4'});
  25. *
  26. * // Create an asset playback ID
  27. * Video.Assets.createPlaybackId(assetId, { policy: 'public' });
  28. */
  29. class Video extends Base {
  30. /**
  31. * Video Constructor
  32. *
  33. * @param {string} accessToken - Mux API Access Token
  34. * @param {string} secret - Mux API secret
  35. * @constructor
  36. */
  37. constructor(...params) {
  38. super(...params);
  39.  
  40. /** @type {Assets} */
  41. this.Assets = new Assets(this);
  42.  
  43. /** @type {LiveStreams} */
  44. this.LiveStreams = new LiveStreams(this);
  45.  
  46. /** @type {PlaybackIds} */
  47. this.PlaybackIds = new PlaybackIds(this);
  48.  
  49. /** @Type {Uploads} */
  50. this.Uploads = new Uploads(this);
  51.  
  52. /** @Type {SigningKeys} */
  53. this.SigningKeys = new SigningKeys(this);
  54.  
  55. /** @Type {DeliveryUsage} */
  56. this.DeliveryUsage = new DeliveryUsage(this);
  57. }
  58. }
  59.  
  60. module.exports = Video;