From a58b4020b5008e0b0ffa68d654ba95378554e110 Mon Sep 17 00:00:00 2001 From: Pavle Goloskokovic Date: Mon, 8 Jan 2018 17:11:15 +0100 Subject: [PATCH] Added HTML5AudioFile class for loading audio with html5 audio tag --- v3/src/loader/filetypes/HTML5AudioFile.js | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 v3/src/loader/filetypes/HTML5AudioFile.js diff --git a/v3/src/loader/filetypes/HTML5AudioFile.js b/v3/src/loader/filetypes/HTML5AudioFile.js new file mode 100644 index 000000000..9ec4ad05d --- /dev/null +++ b/v3/src/loader/filetypes/HTML5AudioFile.js @@ -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;