Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11867

"cordova-plugin-media" 2.4.0 will shut down immediately in iOS when use "getCurrentPosition" method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Resolved
    • 2.4.0
    • None
    • cordova-plugin-media
    • Cordova 6.3.1
      Cordova-android 5.2.2
      Cordova-iOS 4.2.1
      cordova-plugin-media 2.4.0
      Android 6.0.1(HTC)+iOS 9.3.5 13G36(ipad mini)

    Description

      I test many times,these are all my code,just use it directly

      =====
      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 "stop record" and "recordAudio():Audio Success"
      iOS︰it will alert "stop record" and "recordAudio():Audio Success"

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            bau720123 Colin Bau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified