diff --git a/src/gameobjects/Video.js b/src/gameobjects/Video.js index 14d213887..b205730e1 100644 --- a/src/gameobjects/Video.js +++ b/src/gameobjects/Video.js @@ -550,9 +550,10 @@ Phaser.Video.prototype = { * @method Phaser.Video#createVideoFromURL * @param {string} url - The URL of the video. * @param {boolean} [autoplay=false] - Automatically start the video? + * @param {string} crossOrigin - The crossorigin parameter provides support for CORS * @return {Phaser.Video} This Video object for method chaining. */ - createVideoFromURL: function (url, autoplay) + createVideoFromURL: function (url, autoplay, crossOrigin) { if (autoplay === undefined) { autoplay = false; } @@ -570,6 +571,11 @@ Phaser.Video.prototype = { this.video.setAttribute('autoplay', 'autoplay'); } + if (crossOrigin !== undefined) + { + this.video.crossOrigin = crossOrigin; + } + this.video.setAttribute('playsinline', 'playsinline'); this.video.src = url; diff --git a/typescript/phaser.d.ts b/typescript/phaser.d.ts index 346a9c408..e9e24ccff 100644 --- a/typescript/phaser.d.ts +++ b/typescript/phaser.d.ts @@ -3137,7 +3137,7 @@ declare module Phaser { addToWorld(x?: number, y?: number, anchorX?: number, anchorY?: Number, scaleX?: number, scaleY?: number): Phaser.Image; createVideoFromBlob(blob: Blob): Phaser.Video; startMediaStream(captureAudio?: boolean, width?: number, height?: number): Phaser.Video; - createVideoFromURL(url: string, autoplay?: boolean): Phaser.Video; + createVideoFromURL(url: string, autoplay?: boolean, crossOrigin?: string): Phaser.Video; changeSource(src: string, autoplay?: boolean): Phaser.Video; connectToMediaStram(video: any, stream: any): Phaser.Video; destroy(): void;