You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fixed bug where `.` in query portion of URI could throw off
auto-detection
- Allow `Loader#audio` to accept `{uri..,type..}` objects to blobs (and
data) URIs can also be used to auto-format detection / fallbacks.
Copy file name to clipboardExpand all lines: src/loader/Loader.js
+30-18Lines changed: 30 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -718,15 +718,22 @@ Phaser.Loader.prototype = {
718
718
*
719
719
* @method Phaser.Loader#audio
720
720
* @param {string} key - Unique asset key of the audio file.
721
-
* @param {string[]|string} urls - An array containing the URLs of the audio files, i.e.: [ 'jump.mp3', 'jump.ogg', 'jump.m4a' ] or a single string containing just one URL.
722
-
* BLOB urls are supported, but Phaser will not validate the audio file's type in this case; the program must first ensure the BLOB url is playable.
723
-
* @param {boolean} autoDecode - When using Web Audio the audio files can either be decoded at load time or run-time. They can't be played until they are decoded, but this let's you control when that happens. Decoding is a non-blocking async process.
721
+
* @param {string|string[]|object[]} urls - Either a single string or an array of URIs or pairs of `{uri: .., type: ..}`.
722
+
* If an array is specified then the first URI (or URI + mime pair) that is device-compatible will be selected.
723
+
* For example: `"jump.mp3"`, `['jump.mp3', 'jump.ogg', 'jump.m4a']`, or `[{uri: "data:<opus_resource>", type: 'opus'}, 'fallback.mp3']`.
724
+
* BLOB and DATA URIs can be used but only support automatic detection when used in the pair form; otherwise the format must be manually checked before adding the resource.
725
+
* @param {boolean} autoDecode - When using Web Audio the audio files can either be decoded at load time or run-time.
726
+
* Audio files can't be played until they are decoded and, if specified, this enables immediate decoding. Decoding is a non-blocking async process.
0 commit comments