Added channel property to allow audio panning

This commit is contained in:
Rafael Pinto
2018-06-05 02:25:46 +01:00
parent b86a2a7e12
commit 8b931cbc5d
5 changed files with 33 additions and 0 deletions

View File

@@ -650,6 +650,12 @@ class ReactExoplayerView extends FrameLayout implements
}
}
public void setChannel(String channel) {
if (player != null) {
player.setChannel(channel);
}
}
public void seekTo(long positionMs) {
if (player != null) {
eventEmitter.seek(player.getCurrentPosition(), positionMs);

View File

@@ -27,6 +27,7 @@ public class ReactExoplayerViewManager extends ViewGroupManager<ReactExoplayerVi
private static final String PROP_PAUSED = "paused";
private static final String PROP_MUTED = "muted";
private static final String PROP_VOLUME = "volume";
private static final String PROP_CHANNEL = "channel";
private static final String PROP_PROGRESS_UPDATE_INTERVAL = "progressUpdateInterval";
private static final String PROP_SEEK = "seek";
private static final String PROP_RATE = "rate";
@@ -131,6 +132,11 @@ public class ReactExoplayerViewManager extends ViewGroupManager<ReactExoplayerVi
videoView.setVolumeModifier(volume);
}
@ReactProp(name = PROP_CHANNEL)
public void setChannel(final ReactExoplayerView videoView, final String channel) {
videoView.setChannel(channel);
}
@ReactProp(name = PROP_PROGRESS_UPDATE_INTERVAL, defaultFloat = 250.0f)
public void setProgressUpdateInterval(final ReactExoplayerView videoView, final float progressUpdateInterval) {
videoView.setProgressUpdateInterval(progressUpdateInterval);