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 | ||||
|     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 (data.fatal) logger.error(error.message, { currentTime: this.player.currentTime(), data }) | ||||
|       else logger.clientWarn(error.message) | ||||
|  |  | |||
|  | @ -202,7 +202,12 @@ class PeerTubePlugin extends Plugin { | |||
| 
 | ||||
|     this.player.addClass('vjs-error-display-enabled') | ||||
| 
 | ||||
|     logger.error('Fatal error in player', this.player.error()) | ||||
|     // 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()) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   hideFatalError () { | ||||
|  |  | |||
|  | @ -95,6 +95,12 @@ | |||
|           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 | ||||
|         if (document.querySelector('.vjs-can-play')) { | ||||
|           if (window.logger && typeof window.logger.error === 'function') { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Chocobozzz
						Chocobozzz