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

[TIMOB-24082] Android: fix setDataSource error when playing .wav files #8657

Merged
merged 1 commit into from Dec 5, 2016

Conversation

frankieandone
Copy link
Contributor

@frankieandone frankieandone commented Dec 2, 2016

Note: issue is with very specific 4.4 device specifically (S3 4.4.2); other devices/emulators had no issues.

PREREQUISITE

  • whatsupdogs.wav

TEST CASE

var w = Ti.UI.createWindow({
    title: "timob-24082",
    backgroundColor: "#00FF00",
    orientation: Titanium.UI.PORTRAIT
});
//or createSound - same thing
var a = Ti.Media.createAudioPlayer({
    url: 'whatsupdogs.wav',
    exitOnClose: true,
    allowBackground: false
});
var b = Ti.UI.createButton({
    title: "ACTION",
    top: 20,
    width: Ti.UI.SIZE,
    height: Ti.UI.SIZE
});
a.addEventListener("progress", function(e) {
    Ti.API.debug("test msg time played " + Math.round(e.progress) + " ms");
});

a.addEventListener("change", function(e) {
    Ti.API.debug("test msg state " + e.description);
});
a.addEventListener("complete", function(e) {
    Ti.API.debug("test msg finished ");
    b.title = "FINISHED";
});
a.addEventListener("close", function() {
    a.stop();
    if (Ti.platform.osname === "android") {
        a.release();
    }
});
a.addEventListener("error", function(e) {
    Ti.API.error("test msg error " + e);
});
var paused = true;
b.addEventListener("click", function() {
    if (paused) {
        if (a.state == Ti.Media.AudioPlayer.STATE_INITIALIZED) {
            a.start();
        } else {
            a.play();
        }
        paused = false;
        b.title = "PLAYING";
    } else {
        a.pause();
        paused = true;
        b.title = "PAUSED";
    }
});
w.add(b);
w.open();

Expected
Should not be having error when playing wav file

JIRA: https://jira.appcelerator.org/browse/TIMOB-24082

@garymathews
Copy link
Contributor

CR: PASS

@garymathews garymathews merged commit bd3b09f into tidev:master Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants