mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add variable to track playWhenReady status of a TrackSelection instance
This commit is contained in:
parent
ceac959c29
commit
943e165f1f
1 changed files with 14 additions and 0 deletions
|
|
@ -54,6 +54,10 @@ public abstract class BaseTrackSelection implements ExoTrackSelection {
|
||||||
// Lazily initialized hashcode.
|
// Lazily initialized hashcode.
|
||||||
private int hashCode;
|
private int hashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The last playWhenReady value when {@link #onPlayWhenReadyChanged(boolean)} was triggered */
|
||||||
|
private boolean lastPlayWhenReady;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param group The {@link TrackGroup}. Must not be null.
|
* @param group The {@link TrackGroup}. Must not be null.
|
||||||
* @param tracks The indices of the selected tracks within the {@link TrackGroup}. Must not be
|
* @param tracks The indices of the selected tracks within the {@link TrackGroup}. Must not be
|
||||||
|
|
@ -87,6 +91,7 @@ public abstract class BaseTrackSelection implements ExoTrackSelection {
|
||||||
this.tracks[i] = group.indexOf(formats[i]);
|
this.tracks[i] = group.indexOf(formats[i]);
|
||||||
}
|
}
|
||||||
excludeUntilTimes = new long[length];
|
excludeUntilTimes = new long[length];
|
||||||
|
lastPlayWhenReady = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrackSelection implementation.
|
// TrackSelection implementation.
|
||||||
|
|
@ -191,6 +196,15 @@ public abstract class BaseTrackSelection implements ExoTrackSelection {
|
||||||
return excludeUntilTimes[index] > nowMs;
|
return excludeUntilTimes[index] > nowMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlayWhenReadyChanged(boolean playWhenReady) {
|
||||||
|
lastPlayWhenReady = playWhenReady;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final boolean getPlayWhenReady() {
|
||||||
|
return lastPlayWhenReady;
|
||||||
|
}
|
||||||
|
|
||||||
// Object overrides.
|
// Object overrides.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue