Skip to content

Commit c596ddf

Browse files
committed
1 parent d00e271 commit c596ddf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/soundjs/Sound.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,13 +1015,15 @@ this.createjs = this.createjs || {};
10151015
* @since 0.4.0
10161016
*/
10171017
s.registerSound = function (src, id, data, basePath, defaultPlayProps) {
1018-
var loadItem = {src: src, id: id, data:data, defaultPlayProps:defaultPlayProps};
1018+
var loadItem;
10191019
if (src instanceof Object && src.src) {
10201020
basePath = id;
10211021
loadItem = src;
1022+
} else {
1023+
loadItem = {src: src, id: id, data:data, defaultPlayProps:defaultPlayProps};
10221024
}
10231025
loadItem = createjs.LoadItem.create(loadItem);
1024-
loadItem.path = basePath;
1026+
loadItem.path = basePath || "";
10251027

10261028
if (basePath != null && !(loadItem.src instanceof Object)) {loadItem.src = basePath + loadItem.src;}
10271029

0 commit comments

Comments
 (0)