How to use the shaka-player.util function in shaka-player

To help you get started, we’ve selected a few shaka-player examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vimond / replay / src / replay / components / player / VideoStreamer / ShakaVideoStreamer / shakaErrorMapper.js View on Github external
if (shakaError.code === 1002) {
    return 'Shaka request could not be performed for URL ' + shakaError.data[0];
  }
  if (shakaError.code === 1003) {
    return 'Shaka request timed out for URL ' + shakaError.data[0];
  }
  if (shakaError.message) {
    return shakaError.message;
  }
  if (classification === STREAM_ERROR_DRM_CLIENT_UNAVAILABLE) {
    return 'Playback of protected content appears to be disabled in the browser.';
  }
  if (classification === STREAM_ERROR_DRM_OUTPUT_BLOCKED) {
    return 'Playback of protected content appears to be disallowed, perhaps due to a non-secure or HDCP-less screen being connected.';
  }
  const code = reverseLookup(shakaError.code, shaka.util.Error.Code),
    category = reverseLookup(shakaError.category, shaka.util.Error.Category);
  const message = 'Shaka error ' + category + '/' + code + ' reported';

  if (shakaError.data[0]) {
    if (shakaError.data[0].message) {
      return message + ': ' + shakaError.data[0].message;
    } else {
      return message + ': ' + shakaError.data[0];
    }
  } else {
    return message + ' with no further details.';
  }
}
github nus-mtp / worldscope / app_server / public / src / js / modules / pages / stream.js View on Github external
const loadStream = function () {
  let mpdUrl = Stream.stream().link();
  let estimator = new shaka.util.EWMABandwidthEstimator();
  let source = new shaka.player.DashVideoSource(mpdUrl, null, estimator);

  Stream.player.load(source);
};
github vimond / replay / src / replay / components / player / VideoStreamer / ShakaVideoStreamer / shakaErrorMapper.js View on Github external
return 'Shaka request could not be performed for URL ' + shakaError.data[0];
  }
  if (shakaError.code === 1003) {
    return 'Shaka request timed out for URL ' + shakaError.data[0];
  }
  if (shakaError.message) {
    return shakaError.message;
  }
  if (classification === STREAM_ERROR_DRM_CLIENT_UNAVAILABLE) {
    return 'Playback of protected content appears to be disabled in the browser.';
  }
  if (classification === STREAM_ERROR_DRM_OUTPUT_BLOCKED) {
    return 'Playback of protected content appears to be disallowed, perhaps due to a non-secure or HDCP-less screen being connected.';
  }
  const code = reverseLookup(shakaError.code, shaka.util.Error.Code),
    category = reverseLookup(shakaError.category, shaka.util.Error.Category);
  const message = 'Shaka error ' + category + '/' + code + ' reported';

  if (shakaError.data[0]) {
    if (shakaError.data[0].message) {
      return message + ': ' + shakaError.data[0].message;
    } else {
      return message + ': ' + shakaError.data[0];
    }
  } else {
    return message + ' with no further details.';
  }
}
github clappr / dash-shaka-playback / src / clappr-dash-shaka-playback.js View on Github external
_onError (err) {
    const error = {
      shakaError: err,
      videoError: this.el.error
    }

    let { category, code, severity } = error.shakaError.detail || error.shakaError

    if (error.videoError || !code && !category) return super._onError()

    const isCritical = severity === shaka.util.Error.Severity.CRITICAL
    const errorData = {
      code: `${category}_${code}`,
      description: `Category: ${category}, code: ${code}, severity: ${severity}`,
      level: isCritical ? PlayerError.Levels.FATAL : PlayerError.Levels.WARN,
      raw: err
    }
    const formattedError = this.createError(errorData)
    Log.error('Shaka error event:', formattedError)
    this.trigger(Events.PLAYBACK_ERROR, formattedError)
  }
github vimond / replay / src / replay / components / player / VideoStreamer / ShakaVideoStreamer / shakaSourceChangeHandler.js View on Github external
.catch(err => {
        if (err && err.code !== shaka.util.Error.Code.LOAD_INTERRUPTED) {
          throw mapShakaError(false, err, navigator.userAgent, document.location);
        }
      });
  } else if (prevProps && prevProps.source) {

shaka-player

DASH/EME video player library

Apache-2.0
Latest version published 9 days ago

Package Health Score

98 / 100
Full package analysis

Similar packages