cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Bau (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-11867) "cordova-plugin-media" 2.4.0 will shut down immediately in iOS when use "getCurrentPosition" method
Date Sat, 17 Sep 2016 12:37:20 GMT
Colin Bau created CB-11867:
------------------------------

             Summary: "cordova-plugin-media" 2.4.0 will shut down immediately in iOS when
use "getCurrentPosition" method
                 Key: CB-11867
                 URL: https://issues.apache.org/jira/browse/CB-11867
             Project: Apache Cordova
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Plugin Media
    Affects Versions: 2.4.0
         Environment: Cordova 6.3.1
Cordova-android 5.2.2
Cordova-iOS 4.2.1
cordova-plugin-camera 2.4.0
Android 6.0.1(HTC)+iOS 9.3.5 13G36(ipad mini)
            Reporter: Colin Bau
            Priority: Critical


all my code

=====
function recordAudio() {
    if (navigator.userAgent.match(/iPad|iPhone|iPod/i)) {
        var extension = ".wav";
    }
    if (navigator.userAgent.match(/Android/i)) {
        var extension = ".amr";
    }

    var src = 'myrecording' + extension;
    var mediaRec = new Media(src, function() {
        alert("recordAudio():Audio Success");
    }, function(err) {
        alert("recordAudio():Audio Error: " + err.code);
    });
    mediaRec.startRecord();
    setTimeout(function() {
        mediaRec.stopRecord();
        alert('stop record');
    }, 3000);

    setTimeout(function() {
        mediaRec.getCurrentPosition(function(position) {
                if (position > -1) {
                    alert(position + " sec");
                }
            },
            function(e) {
                alert("Error getting pos=" + e);
            }
        );
    }, 5000);
}
=====

when in 3 seconds
Android︰it will alert "recordAudio():Audio Success"
iOS︰it will alert "recordAudio():Audio Success"

when in 5 seconds
Android︰it will alert "-0.001 sec"
iOS︰it will shut down immediately,no any alert trigger



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message