Search in sources :

Example 1 with Playback

use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.

the class MediaWrapper method skip.

public void skip(final String id, final Promise promise) {
    Playback pb = manager.getPlayback();
    if (pb == null)
        return;
    pb.skip(id, promise);
}
Also used : Playback(guichaguri.trackplayer.player.Playback)

Example 2 with Playback

use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.

the class MediaWrapper method getPosition.

public void getPosition(final Promise callback) {
    Playback pb = manager.getPlayback();
    if (checkPlayback(pb, callback))
        return;
    Utils.resolveCallback(callback, Utils.toSeconds(pb.getPosition()));
}
Also used : Playback(guichaguri.trackplayer.player.Playback)

Example 3 with Playback

use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.

the class MediaWrapper method remove.

public void remove(final List<String> ids, final Promise promise) {
    Playback pb = manager.getPlayback();
    if (pb == null)
        return;
    pb.remove(ids, promise);
}
Also used : Playback(guichaguri.trackplayer.player.Playback)

Example 4 with Playback

use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.

the class MediaWrapper method getTrack.

public void getTrack(final String id, final Promise callback) {
    Playback pb = manager.getPlayback();
    if (checkPlayback(pb, callback))
        return;
    for (Track track : pb.getQueue()) {
        if (track.id.equals(id)) {
            Utils.resolveCallback(callback, Arguments.fromBundle(track.toBundle()));
            return;
        }
    }
    Utils.rejectCallback(callback, "track", "No track found");
}
Also used : Playback(guichaguri.trackplayer.player.Playback) Track(guichaguri.trackplayer.logic.track.Track)

Example 5 with Playback

use of guichaguri.trackplayer.player.Playback in project react-native-track-player by react-native-kit.

the class MediaWrapper method play.

public void play() {
    Playback pb = manager.getPlayback();
    if (pb == null)
        return;
    pb.play();
}
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