mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Added HTML5AudioFile class for loading audio with html5 audio tag
This commit is contained in:
parent
e421d50996
commit
a58b4020b5
1 changed files with 28 additions and 0 deletions
28
v3/src/loader/filetypes/HTML5AudioFile.js
Normal file
28
v3/src/loader/filetypes/HTML5AudioFile.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
var Class = require('../../utils/Class');
|
||||
var File = require('../File');
|
||||
var GetFastValue = require('../../utils/object/GetFastValue');
|
||||
|
||||
// Phaser.Loader.FileTypes.HTML5AudioFile
|
||||
|
||||
var HTML5AudioFile = new Class({
|
||||
|
||||
Extends: File,
|
||||
|
||||
initialize:
|
||||
|
||||
function HTML5AudioFile (key, url, path, config)
|
||||
{
|
||||
var fileConfig = {
|
||||
type: 'audio',
|
||||
extension: GetFastValue(url, 'type', ''),
|
||||
key: key,
|
||||
url: GetFastValue(url, 'uri', url),
|
||||
path: path,
|
||||
config: config
|
||||
};
|
||||
|
||||
File.call(this, fileConfig);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = HTML5AudioFile;
|
Loading…
Reference in a new issue