Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26334

iOS: New AVPlayer-based Ti.Media.audioPlayer crashes on second setUrl() call

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 7.5.0
    • Fix Version/s: Release 7.5.0
    • Component/s: iOS
    • Labels:

      Description

      Having tested SDK mobilesdk-7.5.0.v20180821233900-osx to try the new (long-awaited) AVPlayer-based Ti.Media.audioPlayer I have discovered a crucial bug.

      After setting up a player and then using `player.setUrl(URL)` it works fine.

      If you then try to setUrl again, the app will crash.

      This is due to the notification observer for "timedmetadata" not being removed.

      To test:

          var test_player = Ti.Media.createAudioPlayer({ 
              allowBackground: true
          });
       
          var btn = Ti.UI.createButton({
              title:'set url'
          });
          btn.addEventListener('click', function(e){
              test_player.setUrl('URL TO MP3');
             // Will crash on second call.
          });
      

      To fix the issue, please add one line to TiMediaAudioPlayerProxy.m at line 422:

      [[[self player] currentItem] removeObserver:self forKeyPath:@"timedMetadata"];

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              kosso kosso
              Reviewer:
              Vijay Singh
              Tester:
              Samir Mohammed
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-6546
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code