player-errors.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2016 Bilibili. All Rights Reserved.
  3. *
  4. * @author zheng qian <xqq@xqq.im>
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. import {LoaderErrors} from '../io/loader.js';
  19. import DemuxErrors from '../demux/demux-errors.js';
  20. export const ErrorTypes = {
  21. NETWORK_ERROR: 'NetworkError',
  22. MEDIA_ERROR: 'MediaError',
  23. OTHER_ERROR: 'OtherError'
  24. };
  25. export const ErrorDetails = {
  26. NETWORK_EXCEPTION: LoaderErrors.EXCEPTION,
  27. NETWORK_STATUS_CODE_INVALID: LoaderErrors.HTTP_STATUS_CODE_INVALID,
  28. NETWORK_TIMEOUT: LoaderErrors.CONNECTING_TIMEOUT,
  29. NETWORK_UNRECOVERABLE_EARLY_EOF: LoaderErrors.UNRECOVERABLE_EARLY_EOF,
  30. MEDIA_MSE_ERROR: 'MediaMSEError',
  31. MEDIA_FORMAT_ERROR: DemuxErrors.FORMAT_ERROR,
  32. MEDIA_FORMAT_UNSUPPORTED: DemuxErrors.FORMAT_UNSUPPORTED,
  33. MEDIA_CODEC_UNSUPPORTED: DemuxErrors.CODEC_UNSUPPORTED
  34. };