Source: lib/ads/ad_utils.js

  1. /*! @license
  2. * Shaka Player
  3. * Copyright 2016 Google LLC
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. goog.provide('shaka.ads.Utils');
  7. /**
  8. * A class responsible for ad utils.
  9. * @export
  10. */
  11. shaka.ads.Utils = class {
  12. };
  13. /**
  14. * The event name for when a sequence of ads has been loaded.
  15. *
  16. * @const {string}
  17. * @export
  18. */
  19. shaka.ads.Utils.ADS_LOADED = 'ads-loaded';
  20. /**
  21. * The event name for when an ad has started playing.
  22. *
  23. * @const {string}
  24. * @export
  25. */
  26. shaka.ads.Utils.AD_STARTED = 'ad-started';
  27. /**
  28. * The event name for when an ad playhead crosses first quartile.
  29. *
  30. * @const {string}
  31. * @export
  32. */
  33. shaka.ads.Utils.AD_FIRST_QUARTILE = 'ad-first-quartile';
  34. /**
  35. * The event name for when an ad playhead crosses midpoint.
  36. *
  37. * @const {string}
  38. * @export
  39. */
  40. shaka.ads.Utils.AD_MIDPOINT = 'ad-midpoint';
  41. /**
  42. * The event name for when an ad playhead crosses third quartile.
  43. *
  44. * @const {string}
  45. * @export
  46. */
  47. shaka.ads.Utils.AD_THIRD_QUARTILE = 'ad-third-quartile';
  48. /**
  49. * The event name for when an ad has completed playing.
  50. *
  51. * @const {string}
  52. * @export
  53. */
  54. shaka.ads.Utils.AD_COMPLETE = 'ad-complete';
  55. /**
  56. * The event name for when an ad has finished playing
  57. * (played all the way through, was skipped, or was unable to proceed
  58. * due to an error).
  59. *
  60. * @const {string}
  61. * @export
  62. */
  63. shaka.ads.Utils.AD_STOPPED = 'ad-stopped';
  64. /**
  65. * The event name for when an ad is skipped by the user..
  66. *
  67. * @const {string}
  68. * @export
  69. */
  70. shaka.ads.Utils.AD_SKIPPED = 'ad-skipped';
  71. /**
  72. * The event name for when the ad volume has changed.
  73. *
  74. * @const {string}
  75. * @export
  76. */
  77. shaka.ads.Utils.AD_VOLUME_CHANGED = 'ad-volume-changed';
  78. /**
  79. * The event name for when the ad was muted.
  80. *
  81. * @const {string}
  82. * @export
  83. */
  84. shaka.ads.Utils.AD_MUTED = 'ad-muted';
  85. /**
  86. * The event name for when the ad was paused.
  87. *
  88. * @const {string}
  89. * @export
  90. */
  91. shaka.ads.Utils.AD_PAUSED = 'ad-paused';
  92. /**
  93. * The event name for when the ad was resumed after a pause.
  94. *
  95. * @const {string}
  96. * @export
  97. */
  98. shaka.ads.Utils.AD_RESUMED = 'ad-resumed';
  99. /**
  100. * The event name for when the ad's skip status changes
  101. * (usually it becomes skippable when it wasn't before).
  102. *
  103. * @const {string}
  104. * @export
  105. */
  106. shaka.ads.Utils.AD_SKIP_STATE_CHANGED = 'ad-skip-state-changed';
  107. /**
  108. * The event name for when the ad's cue points (start/end markers)
  109. * have changed.
  110. *
  111. * @const {string}
  112. * @export
  113. */
  114. shaka.ads.Utils.CUEPOINTS_CHANGED = 'ad-cue-points-changed';
  115. /**
  116. * The event name for when the native IMA ad manager object has
  117. * loaded and become available.
  118. *
  119. * @const {string}
  120. * @export
  121. */
  122. shaka.ads.Utils.IMA_AD_MANAGER_LOADED = 'ima-ad-manager-loaded';
  123. /**
  124. * The event name for when the native IMA stream manager object has
  125. * loaded and become available.
  126. *
  127. * @const {string}
  128. * @export
  129. */
  130. shaka.ads.Utils.IMA_STREAM_MANAGER_LOADED = 'ima-stream-manager-loaded';
  131. /**
  132. * The event name for when the ad was clicked.
  133. *
  134. * @const {string}
  135. * @export
  136. */
  137. shaka.ads.Utils.AD_CLICKED = 'ad-clicked';
  138. /**
  139. * The event name for when there is an update to the current ad's progress.
  140. *
  141. * @const {string}
  142. * @export
  143. */
  144. shaka.ads.Utils.AD_PROGRESS = 'ad-progress';
  145. /**
  146. * The event name for when the ad is buffering.
  147. *
  148. * @const {string}
  149. * @export
  150. */
  151. shaka.ads.Utils.AD_BUFFERING = 'ad-buffering';
  152. /**
  153. * The event name for when the ad's URL was hit.
  154. *
  155. * @const {string}
  156. * @export
  157. */
  158. shaka.ads.Utils.AD_IMPRESSION = 'ad-impression';
  159. /**
  160. * The event name for when the ad's duration changed.
  161. *
  162. * @const {string}
  163. * @export
  164. */
  165. shaka.ads.Utils.AD_DURATION_CHANGED = 'ad-duration-changed';
  166. /**
  167. * The event name for when the ad was closed by the user.
  168. *
  169. * @const {string}
  170. * @export
  171. */
  172. shaka.ads.Utils.AD_CLOSED = 'ad-closed';
  173. /**
  174. * The event name for when the ad data becomes available.
  175. *
  176. * @const {string}
  177. * @export
  178. */
  179. shaka.ads.Utils.AD_LOADED = 'ad-loaded';
  180. /**
  181. * The event name for when all the ads were completed.
  182. *
  183. * @const {string}
  184. * @export
  185. */
  186. shaka.ads.Utils.ALL_ADS_COMPLETED = 'all-ads-completed';
  187. /**
  188. * The event name for when the ad changes from or to linear.
  189. *
  190. * @const {string}
  191. * @export
  192. */
  193. shaka.ads.Utils.AD_LINEAR_CHANGED = 'ad-linear-changed';
  194. /**
  195. * The event name for when the ad's metadata becomes available.
  196. *
  197. * @const {string}
  198. * @export
  199. */
  200. shaka.ads.Utils.AD_METADATA = 'ad-metadata';
  201. /**
  202. * The event name for when the ad display encountered a recoverable
  203. * error.
  204. *
  205. * @const {string}
  206. * @export
  207. */
  208. shaka.ads.Utils.AD_RECOVERABLE_ERROR = 'ad-recoverable-error';
  209. /**
  210. * The event name for when the ad manager dispatch errors.
  211. *
  212. * @const {string}
  213. * @export
  214. */
  215. shaka.ads.Utils.AD_ERROR = 'ad-error';
  216. /**
  217. * The event name for when the client side SDK signalled its readiness
  218. * to play a VPAID ad or an ad rule.
  219. *
  220. * @const {string}
  221. * @export
  222. */
  223. shaka.ads.Utils.AD_BREAK_READY = 'ad-break-ready';
  224. /**
  225. * The event name for when the interaction callback for the ad was
  226. * triggered.
  227. *
  228. * @const {string}
  229. * @export
  230. */
  231. shaka.ads.Utils.AD_INTERACTION = 'ad-interaction';
  232. /**
  233. * The name of the event for when an ad requires the main content to be paused.
  234. * Fired when the platform does not support multiple media elements.
  235. *
  236. * @const {string}
  237. * @export
  238. */
  239. shaka.ads.Utils.AD_CONTENT_PAUSE_REQUESTED = 'ad-content-pause-requested';
  240. /**
  241. * The name of the event for when an ad requires the main content to be resumed.
  242. * Fired when the platform does not support multiple media elements.
  243. *
  244. * @const {string}
  245. * @export
  246. */
  247. shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED = 'ad-content-resume-requested';
  248. /**
  249. * The name of the event for when an ad requires the video of the main content
  250. * to be attached.
  251. *
  252. * @const {string}
  253. * @export
  254. */
  255. shaka.ads.Utils.AD_CONTENT_ATTACH_REQUESTED = 'ad-content-attach-requested';