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

iOS9.2 no audio

VotersStop watchingWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • None
    • cordova-plugin-media
    • IonicFramework | ngCordova | cordova-plugin-media

    • Important

    Description

      Found an issue with the latest cordova.plugin.media whilst i was putting together a IonicFramework app for iOS 9.2.1 (iPhone 6s) to play an M4A file.
      The iOS logs would show:

      • Found resource '[path].m4a' in the web folder.
        Playing audio sample '[path].m4a'
      • Playing stream with AVPlayer & custom rate

      but no sound (both simulator + device)

      Debugging in Xcode, ./cordova-plugin-media/src/ios/CDVSound.m,ln 352 + 355 appears to be the culprit.
      Instead of using "avPlayer" which doesn't appear to have a handle to the sound resource, switching to "audioFile.player" appears to resolve the sound issue.

          • ./cordova-plugin-media/src/ios/CDVSound.m,ln 352
            from:
            [avPlayer setRate:customRate];

      to:
      [audioFile.player setRate:customRate];

          • ./cordova-plugin-media/src/ios/CDVSound.m,ln 355
            from:
            [avPlayer play];

      to:
      [audioFile.player play];

      NOTE: I've yet to create a PR as I have not signed the Apache ICLA, however i've committed a code in my personal fork and happy for somebody to have a look at it and submit on my behalf:

      https://github.com/spudmashmedia/cordova-plugin-media/commit/946ffcf569cbaa22241e8ec00f11b4a52a0c6809

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            omefire Omar Mefire
            spudmashmedia Johnny Dong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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

                Slack

                  Issue deployment