You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The parameters for this method are deprecated in favor of a single parameter that is an Object or {{#crossLink "PlayPropsConfig"}}{{/crossLink}}.
315
315
*
316
316
* @method play
317
-
* @param {String | Object} [interrupt="none"|options] <b>This parameter will be renamed playProps in the next release.</b><br />
318
-
* This parameter can be an instance of {{#crossLink "PlayPropsConfig"}}{{/crossLink}} or an Object that contains any or all optional properties by name,
319
-
* including: interrupt, delay, offset, loop, volume, pan, startTime, and duration (see the above code sample).
320
-
* <br /><strong>OR</strong><br />
321
-
* <b>Deprecated</b> How to interrupt any currently playing instances of audio with the same source,
322
-
* if the maximum number of instances of the sound are already playing. Values are defined as <code>INTERRUPT_TYPE</code>
323
-
* constants on the Sound class, with the default defined by {{#crossLink "Sound/defaultInterruptBehavior:property"}}{{/crossLink}}.
324
-
* @param {Number} [delay=0] <b>Deprecated</b> The amount of time to delay the start of audio playback, in milliseconds.
325
-
* @param {Number} [offset=0] <b>Deprecated</b> The offset from the start of the audio to begin playback, in milliseconds.
326
-
* @param {Number} [loop=0] <b>Deprecated</b> How many times the audio loops when it reaches the end of playback. The default is 0 (no
327
-
* loops), and -1 can be used for infinite playback.
328
-
* @param {Number} [volume=1] <b>Deprecated</b> The volume of the sound, between 0 and 1. Note that the master volume is applied
329
-
* against the individual volume.
330
-
* @param {Number} [pan=0] <b>Deprecated</b> The left-right pan of the sound (if supported), between -1 (left) and 1 (right).
331
-
* Note that pan is not supported for HTML Audio.
317
+
* @param {Object | PlayPropsConfig} props A PlayPropsConfig instance, or an object that contains the parameters to
318
+
* play a sound. See the {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for more info.
332
319
* @return {AbstractSoundInstance} A reference to itself, intended for chaining calls.
* Play a sound and get a {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} to control. If the sound fails to play, a
1218
-
* AbstractSoundInstance will still be returned, and have a playState of {{#crossLink "Sound/PLAY_FAILED:property"}}{{/crossLink}}.
1219
-
* Note that even on sounds with failed playback, you may still be able to call AbstractSoundInstance {{#crossLink "AbstractSoundInstance/play"}}{{/crossLink}},
1220
-
* since the failure could be due to lack of available channels. If the src does not have a supported extension or
1221
-
* if there is no available plugin, a default AbstractSoundInstance will be returned which will not play any audio, but will not generate errors.
1217
+
* Play a sound and get a {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} to control. If the sound fails to
1218
+
* play, an AbstractSoundInstance will still be returned, and have a playState of {{#crossLink "Sound/PLAY_FAILED:property"}}{{/crossLink}}.
1219
+
* Note that even on sounds with failed playback, you may still be able to call the {{#crossLink "AbstractSoundInstance/play"}}{{/crossLink}},
1220
+
* method, since the failure could be due to lack of available channels. If the src does not have a supported
1221
+
* extension or if there is no available plugin, a default AbstractSoundInstance will still be returned, which will
1222
+
* not play any audio, but will not generate errors.
* var myInstance = createjs.Sound.play("myID", {interrupt: createjs.Sound.INTERRUPT_ANY, loop:-1});
1231
1232
* }
1232
1233
*
1233
-
* NOTE to create an audio sprite that has not already been registered, both startTime and duration need to be set.
1234
+
* NOTE: To create an audio sprite that has not already been registered, both startTime and duration need to be set.
1234
1235
* This is only when creating a new audio sprite, not when playing using the id of an already registered audio sprite.
1235
1236
*
1236
-
* <b>Parameters Deprecated</b><br />
1237
-
* The parameters for this method are deprecated in favor of a single parameter that is an Object or {{#crossLink "PlayPropsConfig"}}{{/crossLink}}.
1238
-
*
1239
1237
* @method play
1240
1238
* @param {String} src The src or ID of the audio.
1241
-
* @param {String | Object} [interrupt="none"|options] <b>This parameter will be renamed playProps in the next release.</b><br />
1242
-
* This parameter can be an instance of {{#crossLink "PlayPropsConfig"}}{{/crossLink}} or an Object that contains any or all optional properties by name,
1243
-
* including: interrupt, delay, offset, loop, volume, pan, startTime, and duration (see the above code sample).
1244
-
* <br /><strong>OR</strong><br />
1245
-
* <b>Deprecated</b> How to interrupt any currently playing instances of audio with the same source,
1246
-
* if the maximum number of instances of the sound are already playing. Values are defined as <code>INTERRUPT_TYPE</code>
1247
-
* constants on the Sound class, with the default defined by {{#crossLink "Sound/defaultInterruptBehavior:property"}}{{/crossLink}}.
1248
-
* @param {Number} [delay=0] <b>Deprecated</b> The amount of time to delay the start of audio playback, in milliseconds.
1249
-
* @param {Number} [offset=0] <b>Deprecated</b> The offset from the start of the audio to begin playback, in milliseconds.
1250
-
* @param {Number} [loop=0] <b>Deprecated</b> How many times the audio loops when it reaches the end of playback. The default is 0 (no
1251
-
* loops), and -1 can be used for infinite playback.
1252
-
* @param {Number} [volume=1] <b>Deprecated</b> The volume of the sound, between 0 and 1. Note that the master volume is applied
1253
-
* against the individual volume.
1254
-
* @param {Number} [pan=0] <b>Deprecated</b> The left-right pan of the sound (if supported), between -1 (left) and 1 (right).
1255
-
* @param {Number} [startTime=null] <b>Deprecated</b> To create an audio sprite (with duration), the initial offset to start playback and loop from, in milliseconds.
1256
-
* @param {Number} [duration=null] <b>Deprecated</b> To create an audio sprite (with startTime), the amount of time to play the clip for, in milliseconds.
1257
-
* @return {AbstractSoundInstance} A {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} that can be controlled after it is created.
1239
+
* @param {Object | PlayPropsConfig} props A PlayPropsConfig instance, or an object that contains the parameters to
1240
+
* play a sound. See the {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for more info.
1241
+
* @return {AbstractSoundInstance} A {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} that can be controlled
0 commit comments