Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCAudio.js a finished playback callback is needed #1837

Open
boqugames opened this issue Feb 23, 2017 · 0 comments
Open

CCAudio.js a finished playback callback is needed #1837

boqugames opened this issue Feb 23, 2017 · 0 comments

Comments

@boqugames
Copy link

Add function codes to cc.Audio class

setFinishCallback: function (cb) {
    if (!this._element) return true;
    this._element.finishedCallback(cb);
},

and add function codes to cc.Audio.WebAudio.prototype

finishedCallback: function (cb) {
    var loop = this._loop;
    this._currentSource.onended = function() {
        if (!loop) {
            cb();
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant