How to use the clappr.Events.PLAYBACK_ERROR function in clappr

To help you get started, we’ve selected a few clappr 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 andrefilimono / clappr-flvjs-playback / src / main.js View on Github external
_onError (type, details, data) {
    Log.error(`flvjs: ${type}: ${details}`, data)

    const formattedError = this.createError({
      code: `${type}_${details}`,
      description: data.msg || details,
      raw: data
    })

    this.trigger(Events.PLAYBACK_ERROR, formattedError)
    this.stop()
  }
github clappr / dash-shaka-playback / index.js View on Github external
_error(type, shakaError) {
    Log.error('an error was raised support=', DashShakaPlayback.support)
    Log.error('an error was raised by shaka player', shakaError.detail)
    this.trigger(Events.PLAYBACK_ERROR, shakaError.detail, this.name)
  }
github clappr / dash-shaka-playback / src / clappr-dash-shaka-playback.js View on Github external
}

    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)
  }