use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.
the class MediaWrapper method pause.
public void pause() {
Playback pb = manager.getPlayback();
if (pb == null)
return;
pb.pause();
}
use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.
the class MediaWrapper method getCurrentTrack.
public void getCurrentTrack(final Promise callback) {
Playback pb = manager.getPlayback();
if (checkPlayback(pb, callback))
return;
Track track = pb.getCurrentTrack();
if (track == null) {
Utils.rejectCallback(callback, "track", "No track playing");
} else {
Utils.resolveCallback(callback, track.id);
}
}
use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.
the class MediaWrapper method getState.
public void getState(final Promise callback) {
Playback pb = manager.getPlayback();
if (checkPlayback(pb, callback))
return;
Utils.resolveCallback(callback, pb.getState());
}
use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.
the class MediaWrapper method add.
public void add(final List<Bundle> tracks, final String insertBeforeId, final Promise promise) {
Playback pb = manager.getPlayback();
if (pb == null)
return;
List<Track> list = new ArrayList<>();
for (int i = 0; i < tracks.size(); i++) {
list.add(new Track(context, manager, tracks.get(i)));
}
pb.add(list, insertBeforeId, promise);
}
use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.
the class MediaWrapper method skipToPrevious.
public void skipToPrevious(final Promise promise) {
Playback pb = manager.getPlayback();
if (pb == null)
return;
pb.skipToPrevious(promise);
}