Browse Source

fix crossOrigin for screenshot

DIYgod 9 years ago
parent
commit
f8c8560af9
3 changed files with 1 additions and 2 deletions
  1. 0 0
      dist/DPlayer.min.js
  2. 0 0
      dist/DPlayer.min.js.map
  3. 1 2
      src/DPlayer.js

File diff suppressed because it is too large
+ 0 - 0
dist/DPlayer.min.js


File diff suppressed because it is too large
+ 0 - 0
dist/DPlayer.min.js.map


+ 1 - 2
src/DPlayer.js

@@ -137,7 +137,7 @@ class DPlayer {
         this.element.innerHTML = `
         this.element.innerHTML = `
             <div class="dplayer-mask"></div>
             <div class="dplayer-mask"></div>
             <div class="dplayer-video-wrap">
             <div class="dplayer-video-wrap">
-                <video class="dplayer-video" ${this.option.video.pic ? `poster="${this.option.video.pic}"` : ``}>
+                <video class="dplayer-video" ${this.option.video.pic ? `poster="${this.option.video.pic}"` : ``} crossorigin="anonymous">
                     <source src="${this.option.video.url}">
                     <source src="${this.option.video.url}">
                 </video>
                 </video>
                 <div class="dplayer-danmaku"></div>
                 <div class="dplayer-danmaku"></div>
@@ -1218,7 +1218,6 @@ class DPlayer {
          */
          */
         const camareIcon = this.element.getElementsByClassName('dplayer-camera-icon')[0];
         const camareIcon = this.element.getElementsByClassName('dplayer-camera-icon')[0];
         camareIcon.addEventListener('click', () => {
         camareIcon.addEventListener('click', () => {
-            this.audio.crossorigin= 'anonymous';
             const canvas = document.createElement("canvas");
             const canvas = document.createElement("canvas");
             canvas.width = this.audio.videoWidth;
             canvas.width = this.audio.videoWidth;
             canvas.height = this.audio.videoHeight;
             canvas.height = this.audio.videoHeight;

Some files were not shown because too many files changed in this diff