about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-06-22 19:24:16 +0200
committerGitHub <noreply@github.com>2020-06-22 19:24:16 +0200
commitaaf91abffae590b2db1b9e6a7dd2a9e2b06b06ca (patch)
tree8ad7bb7d6e40a40e69584c96cb921e6a9900e664
parentc6904c0d3766a2ea8a81ab025c127169ecb51373 (diff)
Fix audio player not working when media files are hosted on a different domain (#14118)
-rw-r--r--app/javascript/mastodon/features/audio/index.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/audio/index.js b/app/javascript/mastodon/features/audio/index.js
index 5f5d85b95..029750d85 100644
--- a/app/javascript/mastodon/features/audio/index.js
+++ b/app/javascript/mastodon/features/audio/index.js
@@ -229,6 +229,7 @@ class Audio extends React.PureComponent {
     window.addEventListener('scroll', this.handleScroll);
 
     const img = new Image();
+    img.crossOrigin = 'anonymous';
     img.onload = () => this.handlePosterLoad(img);
     img.src = this.props.poster;
   }
@@ -236,6 +237,7 @@ class Audio extends React.PureComponent {
   componentDidUpdate (prevProps, prevState) {
     if (prevProps.poster !== this.props.poster) {
       const img = new Image();
+      img.crossOrigin = 'anonymous';
       img.onload = () => this.handlePosterLoad(img);
       img.src = this.props.poster;
     }
@@ -606,6 +608,7 @@ class Audio extends React.PureComponent {
           onPause={this.handlePause}
           onProgress={this.handleProgress}
           onTimeUpdate={this.handleTimeUpdate}
+          crossOrigin='anonymous'
         />
 
         <canvas