Open
Description
Describe the Bug
There is an error on react-native-track-player/lib/src/trackPlayer.js:44:18
export function registerPlaybackService(factory) {
if (Platform.OS === 'android') {
// Registers the headless task
AppRegistry.registerHeadlessTask('TrackPlayer', factory);
}
else if (Platform.OS === 'web') {
factory()(); // <--- HERE there is an extra ()
}
else {
// Initializes and runs the service in the next tick
setImmediate(factory());
}
}
Code To Reproduce
I have the error using...
const chunkBuffer = audioContext.createBuffer(1, chunk.length, audioContext.sampleRate);
chunkBuffer.copyToChannel(chunk, 0);
const source = audioContext.createBufferSource();
source.buffer = chunkBuffer;
source.connect(audioContext.destination);
source.start();
Environment Info:
I'm using Expo react web with react-native-track-player
version 4.1.1
I removed on my node modules the extra '()' and it work as expected.
Regards
Activity