Allow external code to load new audio. (#1409)

If external code can ‘play’, it should be able to ‘load’.  Resolves
compile error in Blockly Games.  Feel free to push back if this API
shouldn’t be public.

Also fix compiler warnings on block defs.  ‘undefined’ means undefined, ‘=‘ means optional.
This commit is contained in:
Neil Fraser
2017-11-01 17:47:24 -07:00
committed by GitHub
parent 63637a927a
commit 6635dada6d
2 changed files with 3 additions and 4 deletions

View File

@@ -728,7 +728,7 @@ Blockly.Block.prototype.setFieldValue = function(newValue, name) {
/**
* Set whether this block can chain onto the bottom of another block.
* @param {boolean} newBoolean True if there can be a previous statement.
* @param {string|Array.<string>|null|undefined} opt_check Statement type or
* @param {(string|Array.<string>|null)=} opt_check Statement type or
* list of statement types. Null/undefined if any type could be connected.
*/
Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) {
@@ -756,7 +756,7 @@ Blockly.Block.prototype.setPreviousStatement = function(newBoolean, opt_check) {
/**
* Set whether another block can chain onto the bottom of this block.
* @param {boolean} newBoolean True if there can be a next statement.
* @param {string|Array.<string>|null|undefined} opt_check Statement type or
* @param {(string|Array.<string>|null)=} opt_check Statement type or
* list of statement types. Null/undefined if any type could be connected.
*/
Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) {
@@ -781,7 +781,7 @@ Blockly.Block.prototype.setNextStatement = function(newBoolean, opt_check) {
/**
* Set whether this block returns a value.
* @param {boolean} newBoolean True if there is an output.
* @param {string|Array.<string>|null|undefined} opt_check Returned type or list
* @param {(string|Array.<string>|null)=} opt_check Returned type or list
* of returned types. Null or undefined if any type could be returned
* (e.g. variable get).
*/

View File

@@ -74,7 +74,6 @@ Blockly.WorkspaceAudio.prototype.dispose = function() {
* preference (i.e. increasing size). E.g. ['media/go.mp3', 'media/go.wav']
* Filenames include path from Blockly's root. File extensions matter.
* @param {string} name Name of sound.
* @package
*/
Blockly.WorkspaceAudio.prototype.load = function(filenames, name) {
if (!filenames.length) {