i am using react-native-music-control
for displaying music notification but because of "no longer maintained" some functionality are not working like seek bar not working etc.,
if anyone have code sample or any example for displaying music notifications using rn-track-player for React Native Video! please provide !
This is my old code where i am using react-native-music-control :-
import MusicControl, {Command} from 'react-native-music-control';
const notificationControl = () => {
if (IsOfflineMode === false) {
MusicControl.setNowPlaying({
title: title,
artwork: thumbnail,
artist: author,
colorized: true,
isLiveStream: IsLive,
});
MusicControl.enableControl('play', true);
MusicControl.enableControl('pause', true);
MusicControl.enableControl('previousTrack', true);
MusicControl.enableControl('nextTrack', true);
MusicControl.enableControl('changePlaybackPosition', true);
MusicControl.handleAudioInterruptions(true);
MusicControl.enableControl('seekForward', false);
}
};
MusicControl.on(Command.pause, () => {
setIsPlaying(true);
});
MusicControl.on('play', () => {
setIsPlaying(false);
});
MusicControl.on(Command.nextTrack, () => {
newProcess('plus');
});
MusicControl.on(Command.previousTrack, () => {
newProcess('subt');
});