mirror of https://github.com/Chocobozzz/PeerTube
Relax error logs with google bot
parent
8fe17abb7c
commit
af9f20d60c
|
@ -298,7 +298,7 @@ export class Html5Hlsjs {
|
||||||
if (this.errorCounts[data.type]) this.errorCounts[data.type] += 1
|
if (this.errorCounts[data.type]) this.errorCounts[data.type] += 1
|
||||||
else this.errorCounts[data.type] = 1
|
else this.errorCounts[data.type] = 1
|
||||||
|
|
||||||
// Google Bot doesn't support our codecs, but we don't really care
|
// Google Bot doesn't support our codecs, but it should not prevent indexing
|
||||||
if (!/googlebot/i.test(navigator.userAgent)) {
|
if (!/googlebot/i.test(navigator.userAgent)) {
|
||||||
if (data.fatal) logger.error(error.message, { currentTime: this.player.currentTime(), data })
|
if (data.fatal) logger.error(error.message, { currentTime: this.player.currentTime(), data })
|
||||||
else logger.clientWarn(error.message)
|
else logger.clientWarn(error.message)
|
||||||
|
|
|
@ -202,8 +202,13 @@ class PeerTubePlugin extends Plugin {
|
||||||
|
|
||||||
this.player.addClass('vjs-error-display-enabled')
|
this.player.addClass('vjs-error-display-enabled')
|
||||||
|
|
||||||
|
// Google Bot may throw codecs, but it should not prevent indexing
|
||||||
|
if (!/googlebot/i.test(navigator.userAgent)) {
|
||||||
|
console.error(this.player.error())
|
||||||
|
} else {
|
||||||
logger.error('Fatal error in player', this.player.error())
|
logger.error('Fatal error in player', this.player.error())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
hideFatalError () {
|
hideFatalError () {
|
||||||
if (!this.errorModal) return
|
if (!this.errorModal) return
|
||||||
|
|
|
@ -95,6 +95,12 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Google Bot doesn't support our codecs, but it should not prevent indexing
|
||||||
|
if (!/googlebot/i.test(navigator.userAgent)) {
|
||||||
|
console.error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Video element is already created, don't crash the player
|
// Video element is already created, don't crash the player
|
||||||
if (document.querySelector('.vjs-can-play')) {
|
if (document.querySelector('.vjs-can-play')) {
|
||||||
if (window.logger && typeof window.logger.error === 'function') {
|
if (window.logger && typeof window.logger.error === 'function') {
|
||||||
|
|
Loading…
Reference in New Issue