diff --git a/package.json b/package.json index 1c352e0f..24cd55f8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "npmName": "preloadjs", "version": "1.0.1", "description": "PreloadJS makes it easy to preload your assets: images, sounds, JavaScript, fonts, JSON, and text data", - "main": "preloadjs.js", + "main": "lib/preloadjs.js", "jsdelivr": "lib/preloadjs.min.js", "directories": { "doc": "docs", diff --git a/src/createjs/events/Event.js b/src/createjs/events/Event.js index 1a983378..f010e269 100644 --- a/src/createjs/events/Event.js +++ b/src/createjs/events/Event.js @@ -53,8 +53,8 @@ this.createjs = this.createjs||{}; * rely on an event object's state outside of the call stack it was received in. * @class Event * @param {String} type The event type. - * @param {Boolean} bubbles Indicates whether the event will bubble through the display list. - * @param {Boolean} cancelable Indicates whether the default behaviour of this event can be cancelled. + * @param {Boolean} [bubbles=false] Indicates whether the event will bubble through the display list. + * @param {Boolean} [cancelable=false] Indicates whether the default behaviour of this event can be cancelled. * @constructor **/ function Event(type, bubbles, cancelable) { @@ -173,7 +173,7 @@ this.createjs = this.createjs||{}; // public methods: /** - * Sets {{#crossLink "Event/defaultPrevented"}}{{/crossLink}} to true if the event is cancelable. + * Sets {{#crossLink "Event/defaultPrevented:property"}}{{/crossLink}} to true if the event is cancelable. * Mirrors the DOM level 2 event standard. In general, cancelable events that have `preventDefault()` called will * cancel the default behaviour associated with the event. * @method preventDefault @@ -183,7 +183,7 @@ this.createjs = this.createjs||{}; }; /** - * Sets {{#crossLink "Event/propagationStopped"}}{{/crossLink}} to true. + * Sets {{#crossLink "Event/propagationStopped:property"}}{{/crossLink}} to true. * Mirrors the DOM event standard. * @method stopPropagation **/ @@ -192,8 +192,8 @@ this.createjs = this.createjs||{}; }; /** - * Sets {{#crossLink "Event/propagationStopped"}}{{/crossLink}} and - * {{#crossLink "Event/immediatePropagationStopped"}}{{/crossLink}} to true. + * Sets {{#crossLink "Event/propagationStopped:property"}}{{/crossLink}} and + * {{#crossLink "Event/immediatePropagationStopped:property"}}{{/crossLink}} to true. * Mirrors the DOM event standard. * @method stopImmediatePropagation **/ diff --git a/src/preloadjs/loaders/AbstractMediaLoader.js b/src/preloadjs/loaders/AbstractMediaLoader.js index a3a0298e..ca8841bd 100644 --- a/src/preloadjs/loaders/AbstractMediaLoader.js +++ b/src/preloadjs/loaders/AbstractMediaLoader.js @@ -70,6 +70,12 @@ this.createjs = this.createjs || {}; this._tag = this._createTag(this._item.src); } + var crossOrigin = this._item.crossOrigin; + if (crossOrigin === true) { crossOrigin = "Anonymous"; } + if (crossOrigin != null && !createjs.URLUtils.isLocal(this._item)) { + this._tag.crossOrigin = crossOrigin; + } + this._tag.preload = "auto"; this._tag.load(); diff --git a/src/preloadjs/loaders/ImageLoader.js b/src/preloadjs/loaders/ImageLoader.js index 87c5c3f6..0f5b89f6 100644 --- a/src/preloadjs/loaders/ImageLoader.js +++ b/src/preloadjs/loaders/ImageLoader.js @@ -94,7 +94,7 @@ this.createjs = this.createjs || {}; } var crossOrigin = this._item.crossOrigin; - if (crossOrigin == true) { crossOrigin = "Anonymous"; } + if (crossOrigin === true) { crossOrigin = "Anonymous"; } if (crossOrigin != null && !createjs.URLUtils.isLocal(this._item)) { this._tag.crossOrigin = crossOrigin; } diff --git a/src/preloadjs/utils/RequestUtils.js b/src/preloadjs/utils/RequestUtils.js index 69200c25..87a2136f 100644 --- a/src/preloadjs/utils/RequestUtils.js +++ b/src/preloadjs/utils/RequestUtils.js @@ -108,6 +108,7 @@ case "ogg": case "mp3": case "webm": + case "aac": return createjs.Types.SOUND; case "mp4": case "webm":