Skip to content

Commit 257a22b

Browse files
committed
When loading Video with the asBlob argument set it now uses a 'blob' type for the XHR loader, and doesn't cast the resulting file as a Blob upon load. This fixes loading videos as blobs on Chrome for Android (thanks @JuCarr phaserjs#2433)
1 parent 41add1b commit 257a22b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
377377
* The Tileset class will tell you the name of the tileset image throwing the uneven size error (thanks @jakewilson #2415)
378378
* Emitter.start when used with a false `explode` parameter would cumulatively add particles to the current total. With quantity 10 the first call would emit 10 particles, the next 20, and so on. Calls to start will now reset the quantity each time. This is a behavior change from earlier versions, so if you relied on the old way please account for it in your code (thanks @BdR76 #2187)
379379
* You can now pass in your own Canvas element to Phaser and it will use that instead of creating one itself. To do so you must pass a Game Configuration object to Phaser when you instantiate it, and set the `canvas` property of the config object to be the DOM element you wish to use, i.e.: `{ canvas: document.getElementById('yourCanvas') }` (thanks @Friksel #2311)
380+
* When loading Video with the `asBlob` argument set it now uses a 'blob' type for the XHR loader, and doesn't cast the resulting file as a Blob upon load. This fixes loading videos as blobs on Chrome for Android (thanks @JuCarr #2433)
380381

381382
### Bug Fixes
382383

src/loader/Loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,7 @@ Phaser.Loader.prototype = {
21152115
{
21162116
if (file.asBlob)
21172117
{
2118-
this.xhrLoad(file, this.transformUrl(file.url, file), 'arraybuffer', this.fileComplete);
2118+
this.xhrLoad(file, this.transformUrl(file.url, file), 'blob', this.fileComplete);
21192119
}
21202120
else
21212121
{
@@ -2702,7 +2702,7 @@ Phaser.Loader.prototype = {
27022702
{
27032703
try
27042704
{
2705-
file.data = new Blob([new Uint8Array(xhr.response)]);
2705+
file.data = xhr.response;
27062706
}
27072707
catch (e)
27082708
{

0 commit comments

Comments
 (0)