Sfoglia il codice sorgente

Adding crossOrigin anonymous on htmlAudioElement

davrous 9 anni fa
parent
commit
84b6f6a953

+ 2 - 0
src/Audio/babylon.sound.js

@@ -87,6 +87,7 @@ var BABYLON;
                             this._htmlAudioElement.src = urlOrArrayBuffer;
                             this._htmlAudioElement.controls = false;
                             this._htmlAudioElement.loop = this.loop;
+                            this._htmlAudioElement.crossOrigin = "anonymous";
                             this._isReadyToPlay = true;
                             document.body.appendChild(this._htmlAudioElement);
                             // Simulating a ready to play event for consistent behavior with non streamed audio source
@@ -442,3 +443,4 @@ var BABYLON;
     })();
     BABYLON.Sound = Sound;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.sound.js.map

+ 1 - 0
src/Audio/babylon.sound.ts

@@ -104,6 +104,7 @@
                             this._htmlAudioElement.src = urlOrArrayBuffer;
                             this._htmlAudioElement.controls = false;
                             this._htmlAudioElement.loop = this.loop;
+                            this._htmlAudioElement.crossOrigin = "anonymous"; 
                             this._isReadyToPlay = true;
                             document.body.appendChild(this._htmlAudioElement);
                             // Simulating a ready to play event for consistent behavior with non streamed audio source

+ 1 - 1
src/babylon.mixins.js

@@ -1 +1 @@
-
+//# sourceMappingURL=babylon.mixins.js.map

+ 4 - 0
src/babylon.mixins.ts

@@ -103,4 +103,8 @@ interface Navigator {
 interface Screen {
     orientation: string;
     mozOrientation: string;
+}
+
+interface HTMLMediaElement {
+    crossOrigin: string;
 }