Cordova media is very slow to play on iOS


#1

I apologize for my bad English but i’m italian and i don’t speak english very well.

I have a problem with audio player, is very slow to start on iOS (not on android).

PlayerLiturgia.play = function() {
     $scope.state = 'loader';
            function mediaStatusCallback(status) {
                if (status == 0) {
                    console.log($scope.state);
                }
                if (status == 1) {
                    $scope.state = 'loader';
                }
                if (status == 2) {
                    $scope.state = 'play';
                }
                if (status == 3) {
                    $scope.state = 'pause';
                }
                if (status == 4) {
                    $scope.state = 'pause';
                }
            };
            if (media == null) {
                media = new Media(src, null, null, mediaStatusCallback);
                console.log('media != null');
            }
            media.play();
            console.log('media.play()');
        };</code>

When i tap play button, audio don’t start, it start after a minute, while on Android it start immediately.

Why?
Thank you for help.


#2

Could you find how to fix this problem? I have the same problem, but with stream audio.

Thank you.


#3

i have the same problem with stream audio, but i have not been able to fix the problem :’(


#4

I have the same issue. Anyone can help?


#5

With the new version of the plugin , 2.2.0 , it solves the problem. But no longer works for local playback.