Skip to content

Sound.stop does not exist #95

@oberhamsi

Description

@oberhamsi

via https://groups.google.com/forum/#!topic/gamejs/wFmkvKyiC6g

The Sound.stop() doesn't work as described in API.

function muteSound(sound) {
sound.stop();
}

bgMusic = new gamejs.audio.Sound(document.getElementById("bgMusic"));
muteSound(bgMusic);

So, it cause an error "audio.stop is not a function".

The solution is to use standard JavaScript methods.
bgMusic = document.getElementById("bgMusic");
muteSound(bgMusic);

function muteSound(sound) {
sound.pause();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions