Handle Cross-Origin canvas error in player

environments/review-front-brok-oyrjvg/deployments/2100
Eliot Berriot 2019-07-02 13:40:09 +02:00
rodzic b20b1accff
commit 7a6ba83d03
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -356,7 +356,11 @@ export default {
return
}
let image = this.$refs.cover
this.ambiantColors = ColorThief.prototype.getPalette(image, 4).slice(0, 4)
try {
this.ambiantColors = ColorThief.prototype.getPalette(image, 4).slice(0, 4)
} catch (e) {
console.log('Cannot generate player background from cover image, likely a cross-origin tainted canvas issue')
}
},
handleError({ sound, error }) {
this.$store.commit("player/isLoadingAudio", false)