]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix audio player not working when media files are hosted on a different...
authorThibG <thib@sitedethib.com>
Mon, 22 Jun 2020 17:24:16 +0000 (19:24 +0200)
committerThibG <thib@sitedethib.com>
Thu, 2 Jul 2020 15:31:09 +0000 (17:31 +0200)
Port aaf91abffae590b2db1b9e6a7dd2a9e2b06b06ca to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/features/audio/index.js

index 172fe4c30932a3307c41a9f55299ca0773a5b3c6..c7f807c8ef84c07d5f5bfc54903ad0a321d4336f 100644 (file)
@@ -228,6 +228,7 @@ class Audio extends React.PureComponent {
  
   componentDidMount () {
     const img = new Image();
+    img.crossOrigin = 'anonymous';
     img.onload = () => this.handlePosterLoad(img);
     img.src = this.props.poster;
   }
@@ -235,6 +236,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;
     }
@@ -588,6 +590,7 @@ class Audio extends React.PureComponent {
           onPause={this.handlePause}
           onProgress={this.handleProgress}
           onTimeUpdate={this.handleTimeUpdate}
+          crossOrigin='anonymous'
         />
 
         <canvas