Search in sources :

Example 11 with Playback

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();
}
Also used : Playback(guichaguri.trackplayer.player.Playback)

Example 12 with Playback

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);
    }
}
Also used : Playback(guichaguri.trackplayer.player.Playback) Track(guichaguri.trackplayer.logic.track.Track)

Example 13 with Playback

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());
}
Also used : Playback(guichaguri.trackplayer.player.Playback)

Example 14 with Playback

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);
}
Also used : Playback(guichaguri.trackplayer.player.Playback) ArrayList(java.util.ArrayList) Track(guichaguri.trackplayer.logic.track.Track)

Example 15 with Playback

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);
}
Also used : Playback(guichaguri.trackplayer.player.Playback)

Aggregations

Playback (guichaguri.trackplayer.player.Playback)18 Track (guichaguri.trackplayer.logic.track.Track)3 ArrayList (java.util.ArrayList)1