mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1783 from VisualSJ/v1.5-5920
#5920 Audio preload error
This commit is contained in:
@@ -85,8 +85,17 @@ Audio.State = {
|
||||
(function (proto) {
|
||||
|
||||
proto.preload = function () {
|
||||
var src = this._src,
|
||||
audio = this;
|
||||
var src = this._src, audio = this;
|
||||
|
||||
if (!src) {
|
||||
this._src = '';
|
||||
this._audioType = Audio.Type.UNKNOWN;
|
||||
this._element = null;
|
||||
this._state = Audio.State.INITIALZING;
|
||||
this._loaded = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var item = cc.loader.getItem(src);
|
||||
|
||||
if (!item) {
|
||||
|
||||
@@ -41,7 +41,11 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
ctor: function () {
|
||||
this.audio = new cc.Audio(this._clip);
|
||||
this.audio = new cc.Audio();
|
||||
},
|
||||
|
||||
onLoad: function () {
|
||||
this.clip = this._clip;
|
||||
},
|
||||
|
||||
properties: {
|
||||
|
||||
Reference in New Issue
Block a user