Skip to content

Commit d1f50b9

Browse files
author
Lanny McNie
committed
Documentation updates
Signed-off-by: Lanny McNie <[email protected]>
1 parent 78751f6 commit d1f50b9

File tree

4 files changed

+109
-140
lines changed

4 files changed

+109
-140
lines changed

src/soundjs/FlashPlugin.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ this.createjs = this.createjs || {};
4343
* {{#crossLink "Sound"}}{{/crossLink}} using the {{#crossLink "Sound/registerPlugins"}}{{/crossLink}} method. This
4444
* plugin is recommended to be included if sound support is required in older browsers such as IE8.
4545
*
46-
* This plugin requires FlashAudioPlugin.swf and swfObject.js (which is compiled
46+
* This plugin requires FlashAudioPlugin.swf and swfObject.js, which is compiled
4747
* into the minified FlashPlugin-X.X.X.min.js file. You must ensure that {{#crossLink "FlashPlugin/swfPath:property"}}{{/crossLink}}
4848
* is set when using this plugin, so that the script can find the swf.
4949
*
@@ -56,10 +56,10 @@ this.createjs = this.createjs || {};
5656
* will have an id of "flashAudioContainer". The container DIV is positioned 1 pixel off-screen to the left to avoid
5757
* showing the 1x1 pixel white square.
5858
*
59-
* <h4>Known Browser and OS issues for HTML Audio</h4>
59+
* <h4>Known Browser and OS issues for Flash Audio</h4>
6060
* <b>All browsers</b><br />
6161
* <ul><li> There can be a delay in flash player starting playback of audio. This has been most noticeable in Firefox.
62-
* Unfortunely this is an issue with the flash player and therefore cannot be addressed by SoundJS.</li></ul>
62+
* Unfortunely this is an issue with the flash player and the browser and therefore cannot be addressed by SoundJS.</li></ul>
6363
*
6464
* @class FlashPlugin
6565
* @constructor
@@ -71,22 +71,23 @@ this.createjs = this.createjs || {};
7171
var s = FlashPlugin;
7272

7373
/**
74-
* The capabilities of the plugin. This is generated via the {{#crossLink "WebAudioPlugin/generateCapabilities"}}{{/crossLink}}
74+
* The capabilities of the plugin. This is generated via the {{#crossLink "WebAudioPlugin/_generateCapabilities"}}{{/crossLink}}
7575
* method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for a list of available
7676
* capabilities.
7777
* @property capabilities
7878
* @type {Object}
79+
* @protected
7980
* @static
8081
*/
8182
s.capabilities = null;
8283

8384
/**
8485
* Deprecated in favor of {{#crossLink "FlashPlugin/swfPath:property"}}{{/crossLink}}
85-
* The path relative to the HTML page that the FlashAudioPlugin.swf resides. Note if this is not correct, this
86+
* <br />The path relative to the HTML page that the FlashAudioPlugin.swf resides. Note if this is not correct, this
8687
* plugin will not work.
8788
* @property BASE_PATH
8889
* @type {String}
89-
* @default src/SoundJS
90+
* @default null
9091
* @static
9192
* @deprecated
9293
*/
@@ -515,7 +516,8 @@ this.createjs = this.createjs || {};
515516
},
516517

517518
// Flash Communication
518-
/**
519+
// Note we have decided not to include these in the docs
520+
/*
519521
* Used to couple a Flash loader instance with a <code>Loader</code> instance
520522
* @method registerPreloadInstance
521523
* @param {String} flashId Used to identify the Loader.
@@ -525,7 +527,7 @@ this.createjs = this.createjs || {};
525527
this.flashPreloadInstances[flashId] = instance;
526528
},
527529

528-
/**
530+
/*
529531
* Used to decouple a <code>Loader</code> instance from Flash.
530532
* @method unregisterPreloadInstance
531533
* @param {String} flashId Used to identify the Loader.
@@ -534,7 +536,7 @@ this.createjs = this.createjs || {};
534536
delete this.flashPreloadInstances[flashId];
535537
},
536538

537-
/**
539+
/*
538540
* Used to couple a Flash sound instance with a {{#crossLink "SoundInstance"}}{{/crossLink}}.
539541
* @method registerSoundInstance
540542
* @param {String} flashId Used to identify the SoundInstance.
@@ -544,7 +546,7 @@ this.createjs = this.createjs || {};
544546
this.flashInstances[flashId] = instance;
545547
},
546548

547-
/**
549+
/*
548550
* Used to decouple a {{#crossLink "SoundInstance"}}{{/crossLink}} from Flash.
549551
* instance.
550552
* @method unregisterSoundInstance
@@ -555,7 +557,7 @@ this.createjs = this.createjs || {};
555557
delete this.flashInstances[flashId];
556558
},
557559

558-
/**
560+
/*
559561
* Used to output traces from Flash to the console, if {{#crossLink "FlashPlugin/showOutput"}}{{/crossLink}} is
560562
* <code>true</code>.
561563
* @method flashLog
@@ -568,7 +570,7 @@ this.createjs = this.createjs || {};
568570
}
569571
},
570572

571-
/**
573+
/*
572574
* Handles events from Flash, and routes communication to a {{#crossLink "SoundInstance"}}{{/crossLink}} via
573575
* the Flash ID. The method and arguments from Flash are run directly on the sound instance.
574576
* @method handleSoundEvent
@@ -594,7 +596,7 @@ this.createjs = this.createjs || {};
594596
}
595597
},
596598

597-
/**
599+
/*
598600
* Handles events from Flash and routes communication to a <code>Loader</code> via the Flash ID. The method
599601
* and arguments from Flash are run directly on the sound loader.
600602
* @method handlePreloadEvent
@@ -620,7 +622,7 @@ this.createjs = this.createjs || {};
620622
}
621623
},
622624

623-
/**
625+
/*
624626
* Handles events from Flash intended for the FlashPlugin class. Currently only a "ready" event is processed.
625627
* @method handleEvent
626628
* @param {String} method Indicates the method to run.
@@ -635,7 +637,7 @@ this.createjs = this.createjs || {};
635637
}
636638
},
637639

638-
/**
640+
/*
639641
* Handles error events from Flash. Note this function currently does not process any events.
640642
* @method handleErrorEvent
641643
* @param {String} error Indicates the error.

src/soundjs/HTMLAudioPlugin.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ this.createjs = this.createjs || {};
4747
* <b>All browsers</b><br />
4848
* Testing has shown in all browsers there is a limit to how many audio tag instances you are allowed. If you exceed
4949
* this limit, you can expect to see unpredictable results. This will be seen as soon as you register sounds, as
50-
* tags are precreated to all Chrome to load them. Please use {{#crossLink "Sound.MAX_INSTANCES"}}{{/crossLink}} as
50+
* tags are precreated to allow Chrome to load them. Please use {{#crossLink "Sound.MAX_INSTANCES"}}{{/crossLink}} as
5151
* a guide to how many total audio tags you can safely use in all browsers.
5252
*
5353
* <b>IE 9 html limitations</b><br />
@@ -63,15 +63,19 @@ this.createjs = this.createjs || {};
6363
* <ul><li>Safari requires Quicktime to be installed for audio playback.</li></ul>
6464
*
6565
* <b>iOS 6 limitations</b><br />
66-
* Note it is recommended to use {{#crossLink "WebAudioPlugin"}}{{/crossLink}} for iOS (6+). HTML Audio is disabled by
67-
* default as it can only have one &lt;audio&gt; tag, can not preload or autoplay the audio, can not cache the audio,
68-
* and can not play the audio except inside a user initiated event.
69-
*<br /><br />
70-
* <b>Android HTML Audio limitations</b><br />
66+
* <ul><li>Note it is recommended to use {{#crossLink "WebAudioPlugin"}}{{/crossLink}} for iOS (6+)</li>
67+
* <li>HTML Audio is disabled by default because</li>
68+
* <li>can only have one &lt;audio&gt; tag</li>
69+
* <li>can not preload or autoplay the audio</li>
70+
* <li>can not cache the audio</li>
71+
* <li>can not play the audio except inside a user initiated event.</li>
72+
* </ul>
73+
*
74+
* <b>Android Native Browser limitations</b><br />
7175
* <ul><li>We have no control over audio volume. Only the user can set volume on their device.</li>
72-
* <li>We can only play audio inside a user event (touch/click). This currently means you cannot loop sound or use a delay.</li>
76+
* <li>We can only play audio inside a user event (touch/click). This currently means you cannot loop sound or use a delay.</li></ul>
7377
* <b> Android Chrome 26.0.1410.58 specific limitations</b><br />
74-
* <li>Chrome reports true when you run createjs.Sound.BrowserDetect.isChrome, but is a different browser
78+
* <ul><li>Chrome reports true when you run createjs.Sound.BrowserDetect.isChrome, but is a different browser
7579
* with different abilities.</li>
7680
* <li>Can only play 1 sound at a time.</li>
7781
* <li>Sound is not cached.</li>
@@ -117,6 +121,7 @@ this.createjs = this.createjs || {};
117121
* @type {String}
118122
* @default canplaythrough
119123
* @static
124+
* @protected
120125
*/
121126
s.AUDIO_READY = "canplaythrough";
122127

@@ -126,6 +131,7 @@ this.createjs = this.createjs || {};
126131
* @type {String}
127132
* @default ended
128133
* @static
134+
* @protected
129135
*/
130136
s.AUDIO_ENDED = "ended";
131137

@@ -135,15 +141,17 @@ this.createjs = this.createjs || {};
135141
* @type {String}
136142
* @default seeked
137143
* @static
144+
* @protected
138145
*/
139146
s.AUDIO_SEEKED = "seeked";
140147

141148
/**
142149
* Event constant for the "error" event for cleaner code.
143150
* @property AUDIO_ERROR
144151
* @type {String}
145-
* @default error
152+
* @default stalled
146153
* @static
154+
* @protected
147155
*/
148156
s.AUDIO_ERROR = "error"; //TODO: Handle error cases
149157

@@ -269,7 +277,7 @@ this.createjs = this.createjs || {};
269277
/**
270278
* Pre-register a sound instance when preloading/setup. This is called by {{#crossLink "Sound"}}{{/crossLink}}.
271279
* Note that this provides an object containing a tag used for preloading purposes, which
272-
* <a href="http://preloadjs.com">PreloadJS</a> can use to assist with preloading.
280+
* <a href="http://preloadjs.com" target="_blank">PreloadJS</a> can use to assist with preloading.
273281
* @method register
274282
* @param {String} src The source of the audio
275283
* @param {Number} instances The number of concurrently playing instances to allow for the channel at any time.
@@ -306,12 +314,15 @@ this.createjs = this.createjs || {};
306314
};
307315
};
308316

317+
// TODO remove this when | approach is removed
309318
/**
319+
* Deprecated as this will not be required with new approach to basePath.
310320
* Checks if src was changed on tag used to create instances in TagPool before loading
311321
* Currently PreloadJS does this when a basePath is set, so we are replicating that behavior for internal preloading.
312322
* @method handleTagLoad
313323
* @param event
314324
* @protected
325+
* @deprecated
315326
*/
316327
p.handleTagLoad = function(event) {
317328
// cleanup and so we don't send the event more than once

0 commit comments

Comments
 (0)