Source: lib/util/error.js

  1. /**
  2. * @license
  3. * Copyright 2016 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. goog.provide('shaka.util.Error');
  18. /**
  19. * Creates a new Error.
  20. *
  21. * @param {shaka.util.Error.Severity} severity
  22. * @param {shaka.util.Error.Category} category
  23. * @param {shaka.util.Error.Code} code
  24. * @param {...*} var_args
  25. *
  26. * @constructor
  27. * @struct
  28. * @export
  29. * @extends {Error}
  30. * @implements {shakaExtern.Error}
  31. */
  32. shaka.util.Error = function(severity, category, code, var_args) {
  33. /**
  34. * @override
  35. * @exportInterface
  36. */
  37. this.severity = severity;
  38. /**
  39. * @override
  40. * @exportInterface
  41. */
  42. this.category = category;
  43. /**
  44. * @override
  45. * @exportInterface
  46. */
  47. this.code = code;
  48. /**
  49. * @override
  50. * @exportInterface
  51. */
  52. this.data = Array.prototype.slice.call(arguments, 3);
  53. /**
  54. * @override
  55. * @exportInterface
  56. */
  57. this.handled = false;
  58. // This improves the formatting of Errors in failure messages in the tests.
  59. if (goog.DEBUG) {
  60. let categoryName = 'UNKNOWN';
  61. let codeName = 'UNKNOWN';
  62. for (let k in shaka.util.Error.Category) {
  63. if (shaka.util.Error.Category[k] == this.category) {
  64. categoryName = k;
  65. }
  66. }
  67. for (let k in shaka.util.Error.Code) {
  68. if (shaka.util.Error.Code[k] == this.code) {
  69. codeName = k;
  70. }
  71. }
  72. /**
  73. * A human-readable version of the category and code.
  74. * <i>(Only available in uncompiled mode.)</i>
  75. *
  76. * @const {string}
  77. * @exportDoc
  78. */
  79. this.message = 'Shaka Error ' + categoryName + '.' + codeName +
  80. ' (' + this.data.toString() + ')';
  81. try {
  82. throw new Error(this.message);
  83. } catch (e) {
  84. /**
  85. * A stack-trace showing where the error occurred.
  86. * <i>(Only available in uncompiled mode.)</i>
  87. *
  88. * @const {string}
  89. * @exportDoc
  90. */
  91. this.stack = e.stack;
  92. }
  93. }
  94. };
  95. /**
  96. * @return {string}
  97. * @override
  98. */
  99. shaka.util.Error.prototype.toString = function() {
  100. return 'shaka.util.Error ' + JSON.stringify(this, null, ' ');
  101. };
  102. /**
  103. * @enum {number}
  104. * @export
  105. */
  106. shaka.util.Error.Severity = {
  107. /**
  108. * An error occurred, but the Player is attempting to recover from the error.
  109. *
  110. * If the Player cannot ultimately recover, it still may not throw a CRITICAL
  111. * error. For example, retrying for a media segment will never result in
  112. * a CRITICAL error (the Player will just retry forever).
  113. */
  114. 'RECOVERABLE': 1,
  115. /**
  116. * A critical error that the library cannot recover from. These usually cause
  117. * the Player to stop loading or updating. A new manifest must be loaded
  118. * to reset the library.
  119. */
  120. 'CRITICAL': 2
  121. };
  122. /**
  123. * @enum {number}
  124. * @export
  125. */
  126. shaka.util.Error.Category = {
  127. /** Errors from the network stack. */
  128. 'NETWORK': 1,
  129. /** Errors parsing text streams. */
  130. 'TEXT': 2,
  131. /** Errors parsing or processing audio or video streams. */
  132. 'MEDIA': 3,
  133. /** Errors parsing the Manifest. */
  134. 'MANIFEST': 4,
  135. /** Errors related to streaming. */
  136. 'STREAMING': 5,
  137. /** Errors related to DRM. */
  138. 'DRM': 6,
  139. /** Miscellaneous errors from the player. */
  140. 'PLAYER': 7,
  141. /** Errors related to cast. */
  142. 'CAST': 8,
  143. /** Errors in the database storage (offline). */
  144. 'STORAGE': 9
  145. };
  146. /**
  147. * @enum {number}
  148. * @export
  149. */
  150. shaka.util.Error.Code = {
  151. /**
  152. * A network request was made using an unsupported URI scheme.
  153. * <br> error.data[0] is the URI.
  154. */
  155. 'UNSUPPORTED_SCHEME': 1000,
  156. /**
  157. * An HTTP network request returned an HTTP status that indicated a failure.
  158. * <br> error.data[0] is the URI.
  159. * <br> error.data[1] is the status code.
  160. * <br> error.data[2] is the response text, or null if the response could not
  161. * be interpretted as text.
  162. * <br> error.data[3] is the map of response headers.
  163. * <br> error.data[4] is the NetworkingEngine.RequestType of the request,
  164. * if one was provided.
  165. */
  166. 'BAD_HTTP_STATUS': 1001,
  167. /**
  168. * An HTTP network request failed with an error, but not from the server.
  169. * <br> error.data[0] is the URI.
  170. * <br> error.data[1] is the original error.
  171. * <br> error.data[2] is the NetworkingEngine.RequestType of the request.
  172. */
  173. 'HTTP_ERROR': 1002,
  174. /**
  175. * A network request timed out.
  176. * <br> error.data[0] is the URI.
  177. * <br> error.data[1] is the NetworkingEngine.RequestType of the request,
  178. * if one was provided.
  179. */
  180. 'TIMEOUT': 1003,
  181. /**
  182. * A network request was made with a malformed data URI.
  183. * <br> error.data[0] is the URI.
  184. */
  185. 'MALFORMED_DATA_URI': 1004,
  186. /**
  187. * A network request was made with a data URI using an unknown encoding.
  188. * <br> error.data[0] is the URI.
  189. */
  190. 'UNKNOWN_DATA_URI_ENCODING': 1005,
  191. /**
  192. * A request filter threw an error.
  193. * <br> error.data[0] is the original error.
  194. */
  195. 'REQUEST_FILTER_ERROR': 1006,
  196. /**
  197. * A response filter threw an error.
  198. * <br> error.data[0] is the original error.
  199. */
  200. 'RESPONSE_FILTER_ERROR': 1007,
  201. /**
  202. * A testing network request was made with a malformed URI.
  203. * This error is only used by unit and integration tests.
  204. */
  205. 'MALFORMED_TEST_URI': 1008,
  206. /**
  207. * An unexpected network request was made to the FakeNetworkingEngine.
  208. * This error is only used by unit and integration tests.
  209. */
  210. 'UNEXPECTED_TEST_REQUEST': 1009,
  211. /** The text parser failed to parse a text stream due to an invalid header. */
  212. 'INVALID_TEXT_HEADER': 2000,
  213. /** The text parser failed to parse a text stream due to an invalid cue. */
  214. 'INVALID_TEXT_CUE': 2001,
  215. // RETIRED: 'INVALID_TEXT_SETTINGS': 2002,
  216. /**
  217. * Was unable to detect the encoding of the response text. Suggest adding
  218. * byte-order-markings to the response data.
  219. */
  220. 'UNABLE_TO_DETECT_ENCODING': 2003,
  221. /** The response data contains invalid Unicode character encoding. */
  222. 'BAD_ENCODING': 2004,
  223. /**
  224. * The XML parser failed to parse an xml stream, or the XML lacks mandatory
  225. * elements for TTML.
  226. * <br> error.data[0] is the URI associated with the XML.
  227. */
  228. 'INVALID_XML': 2005,
  229. // RETIRED: 'INVALID_TTML': 2006,
  230. /**
  231. * MP4 segment does not contain TTML.
  232. */
  233. 'INVALID_MP4_TTML': 2007,
  234. /**
  235. * MP4 segment does not contain VTT.
  236. */
  237. 'INVALID_MP4_VTT': 2008,
  238. /**
  239. * When examining media in advance, we were unable to extract the cue time.
  240. * This should only be possible with HLS, where we do not have explicit
  241. * segment start times.
  242. * <br> error.data[0] is the underlying exception or Error object.
  243. */
  244. 'UNABLE_TO_EXTRACT_CUE_START_TIME': 2009,
  245. /**
  246. * Some component tried to read past the end of a buffer. The segment index,
  247. * init segment, or PSSH may be malformed.
  248. */
  249. 'BUFFER_READ_OUT_OF_BOUNDS': 3000,
  250. /**
  251. * Some component tried to parse an integer that was too large to fit in a
  252. * JavaScript number without rounding error. JavaScript can only natively
  253. * represent integers up to 53 bits.
  254. */
  255. 'JS_INTEGER_OVERFLOW': 3001,
  256. /**
  257. * The EBML parser used to parse the WebM container encountered an integer,
  258. * ID, or other field larger than the maximum supported by the parser.
  259. */
  260. 'EBML_OVERFLOW': 3002,
  261. /**
  262. * The EBML parser used to parse the WebM container encountered a floating-
  263. * point field of a size not supported by the parser.
  264. */
  265. 'EBML_BAD_FLOATING_POINT_SIZE': 3003,
  266. /**
  267. * The MP4 SIDX parser found the wrong box type.
  268. * Either the segment index range is incorrect or the data is corrupt.
  269. */
  270. 'MP4_SIDX_WRONG_BOX_TYPE': 3004,
  271. /**
  272. * The MP4 SIDX parser encountered an invalid timescale.
  273. * The segment index data may be corrupt.
  274. */
  275. 'MP4_SIDX_INVALID_TIMESCALE': 3005,
  276. /** The MP4 SIDX parser encountered a type of SIDX that is not supported. */
  277. 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,
  278. /**
  279. * The WebM Cues parser was unable to locate the Cues element.
  280. * The segment index data may be corrupt.
  281. */
  282. 'WEBM_CUES_ELEMENT_MISSING': 3007,
  283. /**
  284. * The WebM header parser was unable to locate the Ebml element.
  285. * The init segment data may be corrupt.
  286. */
  287. 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,
  288. /**
  289. * The WebM header parser was unable to locate the Segment element.
  290. * The init segment data may be corrupt.
  291. */
  292. 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,
  293. /**
  294. * The WebM header parser was unable to locate the Info element.
  295. * The init segment data may be corrupt.
  296. */
  297. 'WEBM_INFO_ELEMENT_MISSING': 3010,
  298. /**
  299. * The WebM header parser was unable to locate the Duration element.
  300. * The init segment data may be corrupt or may have been incorrectly encoded.
  301. * Shaka requires a duration in WebM DASH content.
  302. */
  303. 'WEBM_DURATION_ELEMENT_MISSING': 3011,
  304. /**
  305. * The WebM Cues parser was unable to locate the Cue Track Positions element.
  306. * The segment index data may be corrupt.
  307. */
  308. 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,
  309. /**
  310. * The WebM Cues parser was unable to locate the Cue Time element.
  311. * The segment index data may be corrupt.
  312. */
  313. 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,
  314. /**
  315. * A MediaSource operation failed.
  316. * <br> error.data[0] is a MediaError code from the video element.
  317. */
  318. 'MEDIA_SOURCE_OPERATION_FAILED': 3014,
  319. /**
  320. * A MediaSource operation threw an exception.
  321. * <br> error.data[0] is the exception that was thrown.
  322. */
  323. 'MEDIA_SOURCE_OPERATION_THREW': 3015,
  324. /**
  325. * The video element reported an error.
  326. * <br> error.data[0] is a MediaError code from the video element.
  327. * <br> On Edge & IE, error.data[1] is a Microsoft extended error code in hex.
  328. * <br> On Chrome, error.data[2] is a string with details on the error.
  329. */
  330. 'VIDEO_ERROR': 3016,
  331. /**
  332. * A MediaSource operation threw QuotaExceededError and recovery failed. The
  333. * content cannot be played correctly because the segments are too large for
  334. * the browser/platform. This may occur when attempting to play very high
  335. * quality, very high bitrate content on low-end devices.
  336. * <br> error.data[0] is the type of content which caused the error.
  337. */
  338. 'QUOTA_EXCEEDED_ERROR': 3017,
  339. /**
  340. * Mux.js did not invoke the callback signifying successful transmuxing.
  341. */
  342. 'TRANSMUXING_FAILED': 3018,
  343. /**
  344. * The Player was unable to guess the manifest type based on file extension
  345. * or MIME type. To fix, try one of the following:
  346. * <br><ul>
  347. * <li>Rename the manifest so that the URI ends in a well-known extension.
  348. * <li>Configure the server to send a recognizable Content-Type header.
  349. * <li>Configure the server to accept a HEAD request for the manifest.
  350. * </ul>
  351. * <br> error.data[0] is the manifest URI.
  352. */
  353. 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,
  354. /** The DASH Manifest contained invalid XML markup. */
  355. 'DASH_INVALID_XML': 4001,
  356. /**
  357. * The DASH Manifest contained a Representation with insufficient segment
  358. * information.
  359. */
  360. 'DASH_NO_SEGMENT_INFO': 4002,
  361. /** The DASH Manifest contained an AdaptationSet with no Representations. */
  362. 'DASH_EMPTY_ADAPTATION_SET': 4003,
  363. /** The DASH Manifest contained an Period with no AdaptationSets. */
  364. 'DASH_EMPTY_PERIOD': 4004,
  365. /**
  366. * The DASH Manifest does not specify an init segment with a WebM container.
  367. */
  368. 'DASH_WEBM_MISSING_INIT': 4005,
  369. /** The DASH Manifest contained an unsupported container format. */
  370. 'DASH_UNSUPPORTED_CONTAINER': 4006,
  371. /** The embedded PSSH data has invalid encoding. */
  372. 'DASH_PSSH_BAD_ENCODING': 4007,
  373. /**
  374. * There is an AdaptationSet whose Representations do not have any common
  375. * key-systems.
  376. */
  377. 'DASH_NO_COMMON_KEY_SYSTEM': 4008,
  378. /** Having multiple key IDs per Representation is not supported. */
  379. 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,
  380. /** The DASH Manifest specifies conflicting key IDs. */
  381. 'DASH_CONFLICTING_KEY_IDS': 4010,
  382. /**
  383. * The manifest contains a period with no playable streams.
  384. * Either the period was originally empty, or the streams within cannot be
  385. * played on this browser or platform.
  386. */
  387. 'UNPLAYABLE_PERIOD': 4011,
  388. /**
  389. * There exist some streams that could be decoded, but restrictions imposed
  390. * by the application or the key system prevent us from playing. This may
  391. * happen under the following conditions:
  392. * <ul>
  393. * <li>The application has given restrictions to the Player that restrict
  394. * at least one content type completely (e.g. no playable audio).
  395. * <li>The manifest specifies different keys than were given to us from the
  396. * license server.
  397. * <li>The key system has imposed output restrictions that cannot be met
  398. * (such as HDCP) and there are no unrestricted alternatives.
  399. * </ul>
  400. */
  401. 'RESTRICTIONS_CANNOT_BE_MET': 4012,
  402. // RETIRED: 'INTERNAL_ERROR_KEY_STATUS': 4013,
  403. /**
  404. * No valid periods were found in the manifest. Please check that your
  405. * manifest is correct and free of typos.
  406. */
  407. 'NO_PERIODS': 4014,
  408. /**
  409. * HLS playlist doesn't start with a mandory #EXTM3U tag.
  410. */
  411. 'HLS_PLAYLIST_HEADER_MISSING': 4015,
  412. /**
  413. * HLS tag has an invalid name that doesn't start with '#EXT'
  414. * <br> error.data[0] is the invalid tag.
  415. */
  416. 'INVALID_HLS_TAG': 4016,
  417. /**
  418. * HLS playlist has both Master and Media/Segment tags.
  419. */
  420. 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,
  421. /**
  422. * A Representation has an id that is the same as another Representation in
  423. * the same Period. This makes manifest updates impossible since we cannot
  424. * map the updated Representation to the old one.
  425. */
  426. 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,
  427. // RETIRED: 'HLS_MEDIA_INIT_SECTION_INFO_MISSING': 4019,
  428. /**
  429. * HLS manifest has several #EXT-X-MAP tags. We can only
  430. * support one at the moment.
  431. */
  432. 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,
  433. /**
  434. * HLS parser was unable to guess mime type of a stream.
  435. * <br> error.data[0] is the stream file's extension.
  436. */
  437. 'HLS_COULD_NOT_GUESS_MIME_TYPE': 4021,
  438. /**
  439. * No Master Playlist has been provided. Master playlist provides
  440. * vital information about the streams (like codecs) that is
  441. * required for MediaSource. We don't support directly providing
  442. * a Media Playlist.
  443. */
  444. 'HLS_MASTER_PLAYLIST_NOT_PROVIDED': 4022,
  445. /**
  446. * One of the required attributes was not provided, so the
  447. * HLS manifest is invalid.
  448. * <br> error.data[0] is the missing attribute's name.
  449. */
  450. 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,
  451. /**
  452. * One of the required tags was not provided, so the
  453. * HLS manifest is invalid.
  454. * <br> error.data[0] is the missing tag's name.
  455. */
  456. 'HLS_REQUIRED_TAG_MISSING': 4024,
  457. /**
  458. * The HLS parser was unable to guess codecs of a stream.
  459. * <br> error.data[0] is the list of all codecs for the variant.
  460. */
  461. 'HLS_COULD_NOT_GUESS_CODECS': 4025,
  462. /**
  463. * The HLS parser has encountered encrypted content with unsupported
  464. * KEYFORMAT attributes.
  465. */
  466. 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,
  467. /**
  468. * The manifest parser only supports xlink links with xlink:actuate="onLoad".
  469. */
  470. 'DASH_UNSUPPORTED_XLINK_ACTUATE': 4027,
  471. /**
  472. * The manifest parser has hit its depth limit on xlink link chains.
  473. */
  474. 'DASH_XLINK_DEPTH_LIMIT': 4028,
  475. // RETIRED: 'HLS_LIVE_CONTENT_NOT_SUPPORTED': 4029,
  476. /**
  477. * The HLS parser was unable to parse segment start time from the media.
  478. */
  479. 'HLS_COULD_NOT_PARSE_SEGMENT_START_TIME': 4030,
  480. // RETIRED: 'HLS_MEDIA_SEQUENCE_REQUIRED_IN_LIVE_STREAMS': 4031,
  481. /**
  482. * The content container or codecs are not supported by this browser. For
  483. * example, this could happen if the content is WebM, but your browser does
  484. * not support the WebM container, or if the content uses HEVC, but your
  485. * browser does not support the HEVC codec. This can also occur for
  486. * multicodec or multicontainer manifests if none of the codecs or containers
  487. * are supported by the browser.
  488. *
  489. * To see what your browser supports, you can check the JSON data dumped by
  490. * http://support.shaka-player-demo.appspot.com/
  491. */
  492. 'CONTENT_UNSUPPORTED_BY_BROWSER': 4032,
  493. /**
  494. * External text tracks cannot be added to live streams.
  495. */
  496. 'CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM': 4033,
  497. // RETIRED: 'INCONSISTENT_BUFFER_STATE': 5000,
  498. // RETIRED: 'INVALID_SEGMENT_INDEX': 5001,
  499. // RETIRED: 'SEGMENT_DOES_NOT_EXIST': 5002,
  500. // RETIRED: 'CANNOT_SATISFY_BYTE_LIMIT': 5003,
  501. // RETIRED: 'BAD_SEGMENT': 5004,
  502. /**
  503. * The StreamingEngine called onChooseStreams() but the callback receiver
  504. * did not return the correct number or type of Streams.
  505. *
  506. * This can happen when there is multi-Period content where one Period is
  507. * video+audio and another is video-only or audio-only. We don't support this
  508. * case because it is incompatible with MSE. When the browser reaches the
  509. * transition, it will pause, waiting for the audio stream.
  510. */
  511. 'INVALID_STREAMS_CHOSEN': 5005,
  512. /**
  513. * The manifest indicated protected content, but the manifest parser was
  514. * unable to determine what key systems should be used.
  515. */
  516. 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
  517. /**
  518. * None of the requested key system configurations are available. This may
  519. * happen under the following conditions:
  520. * <ul>
  521. * <li> The key system is not supported.
  522. * <li> The key system does not support the features requested (e.g.
  523. * persistent state).
  524. * <li> A user prompt was shown and the user denied access.
  525. * <li> The key system is not available from unsecure contexts. (i.e.
  526. requires HTTPS) See https://goo.gl/EEhZqT.
  527. * </ul>
  528. */
  529. 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
  530. /**
  531. * The browser found one of the requested key systems, but it failed to
  532. * create an instance of the CDM for some unknown reason.
  533. * <br> error.data[0] is an error message string from the browser.
  534. */
  535. 'FAILED_TO_CREATE_CDM': 6002,
  536. /**
  537. * The browser found one of the requested key systems and created an instance
  538. * of the CDM, but it failed to attach the CDM to the video for some unknown
  539. * reason.
  540. * <br> error.data[0] is an error message string from the browser.
  541. */
  542. 'FAILED_TO_ATTACH_TO_VIDEO': 6003,
  543. /**
  544. * The CDM rejected the server certificate supplied by the application.
  545. * The certificate may be malformed or in an unsupported format.
  546. * <br> error.data[0] is an error message string from the browser.
  547. */
  548. 'INVALID_SERVER_CERTIFICATE': 6004,
  549. /**
  550. * The CDM refused to create a session for some unknown reason.
  551. * <br> error.data[0] is an error message string from the browser.
  552. */
  553. 'FAILED_TO_CREATE_SESSION': 6005,
  554. /**
  555. * The CDM was unable to generate a license request for the init data it was
  556. * given. The init data may be malformed or in an unsupported format.
  557. * <br> error.data[0] is an error message string from the browser.
  558. * <br> error.data[1] is the error object from the browser.
  559. * <br> error.data[2] is a string with the extended error code, if available.
  560. */
  561. 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,
  562. /**
  563. * The license request failed. This could be a timeout, a network failure, or
  564. * a rejection by the server.
  565. * <br> error.data[0] is a shaka.util.Error from the networking engine.
  566. */
  567. 'LICENSE_REQUEST_FAILED': 6007,
  568. /**
  569. * The license response was rejected by the CDM. The server's response may be
  570. * invalid or malformed for this CDM.
  571. * <br> error.data[0] is an error message string from the browser.
  572. */
  573. 'LICENSE_RESPONSE_REJECTED': 6008,
  574. // RETIRED: 'NO_LICENSE_SERVER_SPECIFIED': 6009,
  575. /**
  576. * The manifest does not specify any DRM info, but the content is encrypted.
  577. * Either the manifest or the manifest parser are broken.
  578. */
  579. 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,
  580. // RETIRED: 'WRONG_KEYS': 6011,
  581. /**
  582. * No license server was given for the key system signaled by the manifest.
  583. * A license server URI is required for every key system.
  584. */
  585. 'NO_LICENSE_SERVER_GIVEN': 6012,
  586. /**
  587. * A required offline session was removed. The content is not playable.
  588. */
  589. 'OFFLINE_SESSION_REMOVED': 6013,
  590. /**
  591. * The license has expired. This is triggered when all keys in the key
  592. * status map have a status of 'expired'.
  593. */
  594. 'EXPIRED': 6014,
  595. /**
  596. * The call to Player.load() was interrupted by a call to Player.unload()
  597. * or another call to Player.load().
  598. */
  599. 'LOAD_INTERRUPTED': 7000,
  600. /**
  601. * An internal error which indicates that an operation was aborted. This
  602. * should not be seen by applications.
  603. */
  604. 'OPERATION_ABORTED': 7001,
  605. /**
  606. * The call to Player.load() failed because the Player does not have a video
  607. * element. The video element must either be provided to the constructor or
  608. * to Player.attach() before Player.load() is called.
  609. */
  610. 'NO_VIDEO_ELEMENT': 7002,
  611. /**
  612. * The Cast API is unavailable. This may be because of one of the following:
  613. * 1. The browser may not have Cast support
  614. * 2. The browser may be missing a necessary Cast extension
  615. * 3. The Cast sender library may not be loaded in your app
  616. */
  617. 'CAST_API_UNAVAILABLE': 8000,
  618. /**
  619. * No cast receivers are available at this time.
  620. */
  621. 'NO_CAST_RECEIVERS': 8001,
  622. /**
  623. * The library is already casting.
  624. */
  625. 'ALREADY_CASTING': 8002,
  626. /**
  627. * A Cast SDK error that we did not explicitly plan for has occurred.
  628. * Check data[0] and refer to the Cast SDK documentation for details.
  629. * <br> error.data[0] is an error object from the Cast SDK.
  630. */
  631. 'UNEXPECTED_CAST_ERROR': 8003,
  632. /**
  633. * The cast operation was canceled by the user.
  634. * <br> error.data[0] is an error object from the Cast SDK.
  635. */
  636. 'CAST_CANCELED_BY_USER': 8004,
  637. /**
  638. * The cast connection timed out.
  639. * <br> error.data[0] is an error object from the Cast SDK.
  640. */
  641. 'CAST_CONNECTION_TIMED_OUT': 8005,
  642. /**
  643. * The requested receiver app ID does not exist or is unavailable.
  644. * Check the requested app ID for typos.
  645. * <br> error.data[0] is an error object from the Cast SDK.
  646. */
  647. 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,
  648. /**
  649. * Offline storage is not supported on this browser; it is required for
  650. * offline support.
  651. */
  652. 'STORAGE_NOT_SUPPORTED': 9000,
  653. /**
  654. * An unknown error occurred in the IndexedDB.
  655. * <br> On Firefox, one common source for UnknownError calls is reverting
  656. * Firefox to an old version. This makes the IndexedDB storage inaccessible
  657. * for older versions. The only way to fix this is to delete the storage
  658. * data in your profile. See https://goo.gl/eKVPPe.
  659. * <br> error.data[0] is the error object.
  660. */
  661. 'INDEXED_DB_ERROR': 9001,
  662. /**
  663. * The storage operation was aborted. Deprecated in favor of more general
  664. * OPERATION_ABORTED.
  665. */
  666. 'DEPRECATED_OPERATION_ABORTED': 9002,
  667. /**
  668. * The specified item was not found in the IndexedDB.
  669. * <br> error.data[0] is the offline URI.
  670. */
  671. 'REQUESTED_ITEM_NOT_FOUND': 9003,
  672. /**
  673. * A network request was made with a malformed offline URI.
  674. * <br> error.data[0] is the URI.
  675. */
  676. 'MALFORMED_OFFLINE_URI': 9004,
  677. /**
  678. * The specified content is live or in-progress.
  679. * Live and in-progress streams cannot be stored offline.
  680. * <br> error.data[0] is the URI.
  681. */
  682. 'CANNOT_STORE_LIVE_OFFLINE': 9005,
  683. /**
  684. * There is already a store operation in-progress. Wait until it completes
  685. * before starting another.
  686. */
  687. 'STORE_ALREADY_IN_PROGRESS': 9006,
  688. /**
  689. * The specified manifest is encrypted but does not specify any init data.
  690. * Without init data specified in the manifest, the content will not be
  691. * playable offline.
  692. * <br> error.data[0] is the URI.
  693. */
  694. 'NO_INIT_DATA_FOR_OFFLINE': 9007,
  695. /**
  696. * shaka.offline.Storage was constructed with a Player proxy instead of a
  697. * local player instance. To fix this, use Player directly with Storage
  698. * instead of the results of CastProxy.prototype.getPlayer().
  699. */
  700. 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008,
  701. // RETIRED/MOVED TO 4000's: 'CONTENT_UNSUPPORTED_BY_BROWSER': 9009,
  702. // RETIRED: 'UNSUPPORTED_UPGRADE_REQUEST': 9010,
  703. /**
  704. * The storage cell does not allow new operations that require new keys.
  705. */
  706. 'NEW_KEY_OPERATION_NOT_SUPPORTED': 9011,
  707. /**
  708. * A key was not found in a storage cell.
  709. */
  710. 'KEY_NOT_FOUND': 9012,
  711. /**
  712. * A storage cell was not found.
  713. */
  714. 'MISSING_STORAGE_CELL': 9013,
  715. };