react-native-sound icon indicating copy to clipboard operation
react-native-sound copied to clipboard

Network file not always loading

Open gregoiredumas opened this issue 7 years ago • 3 comments
trafficstars

When getting a new Sound from the network it doesn't always load and the callback isn't fired. This is what I have right now:

if (!this.audio) {
            var audio = new Sound("http://www.noiseaddicts.com/samples_1w72b820/130.mp3", undefined, (e) => {
                if (e) {
                    console.log('error', e);
                    return;
                } else {
                    console.log("success");
                    console.log('sound: duration in seconds: ' + audio.getDuration());
                }
            }, {loadSync:true} );
            this.audio = audio;
        }


`loadSync:true` is because I'm using #318 

gregoiredumas avatar Jan 03 '18 22:01 gregoiredumas

Does this happen to with larger files?

trepidity avatar Jan 10 '18 03:01 trepidity

@trepidity it's very inconsistent but it seems to happen more often on larger files

gregoiredumas avatar Jan 11 '18 01:01 gregoiredumas

较大的文件会发生这种情况吗?

yeah, do you solve it ?

13627491210 avatar Oct 04 '22 07:10 13627491210