Source: externs/shaka/queue.js

  1. /*! @license
  2. * Shaka Player
  3. * Copyright 2016 Google LLC
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @externs
  8. */
  9. /**
  10. * @typedef {{
  11. * manifestUri: string,
  12. * startTime: ?(number|Date),
  13. * mimeType: ?string,
  14. * config: ?shaka.extern.PlayerConfiguration,
  15. * extraText: ?Array<!shaka.extern.ExtraText>,
  16. * extraThumbnail: ?Array<string>,
  17. * extraChapter: ?Array<!shaka.extern.ExtraChapter>
  18. * }}
  19. *
  20. * @property {string} manifestUri
  21. * @property {?(number|Date)} startTime
  22. * @property {?string} mimeType
  23. * @property {?shaka.extern.PlayerConfiguration} config
  24. * @property {?Array<!shaka.extern.ExtraText>} extraText
  25. * @property {?Array<string>} extraThumbnail
  26. * @property {?Array<!shaka.extern.ExtraChapter>} extraChapter
  27. * @exportDoc
  28. */
  29. shaka.extern.QueueItem;
  30. /**
  31. * An object that's responsible for all the queue-related logic
  32. * in the player.
  33. *
  34. * @interface
  35. * @extends {shaka.util.IDestroyable}
  36. * @exportDoc
  37. */
  38. shaka.extern.IQueueManager = class extends EventTarget {
  39. /**
  40. * @return {!Promise}
  41. */
  42. destroy() {}
  43. /**
  44. * Called by the Player to provide an updated configuration any time it
  45. * changes.
  46. *
  47. * @param {shaka.extern.QueueConfiguration} config
  48. */
  49. configure(config) {}
  50. /**
  51. * Returns the current configuration.
  52. *
  53. * @return {?shaka.extern.QueueConfiguration}
  54. */
  55. getConfiguration() {}
  56. /**
  57. * Returns the current item.
  58. *
  59. * @return {?shaka.extern.QueueItem}
  60. */
  61. getCurrentItem() {}
  62. /**
  63. * Returns the index of the current playing item.
  64. *
  65. * @return {number}
  66. */
  67. getCurrentItemIndex() {}
  68. /**
  69. * Returns all items.
  70. *
  71. * @return {!Array<shaka.extern.QueueItem>}
  72. */
  73. getItems() {}
  74. /**
  75. * Insert new items in the current queue.
  76. *
  77. * @param {!Array<shaka.extern.QueueItem>} items
  78. */
  79. insertItems(items) {}
  80. /**
  81. * Remove all items.
  82. *
  83. * @return {!Promise}
  84. */
  85. removeAllItems() {}
  86. /**
  87. * Plays a item number in the queue.
  88. *
  89. * @param {number} itemIndex
  90. * @return {!Promise}
  91. */
  92. playItem(itemIndex) {}
  93. };
  94. /**
  95. * A factory for creating the queue manager.
  96. *
  97. * @typedef {function(shaka.Player):!shaka.extern.IQueueManager}
  98. * @exportDoc
  99. */
  100. shaka.extern.IQueueManager.Factory;