Some log functions removed
Some log functions removed
This commit is contained in:
parent
41cbf073c7
commit
9dead2fefc
@ -84,7 +84,7 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
|
|
||||||
private static final String TAG = "ReactExoplayerView";
|
private static final String TAG = "ReactExoplayerView";
|
||||||
|
|
||||||
private static DefaultBandwidthMeter BANDWIDTH_METER; // = new DefaultBandwidthMeter();
|
private static DefaultBandwidthMeter BANDWIDTH_METER;
|
||||||
private static final CookieManager DEFAULT_COOKIE_MANAGER;
|
private static final CookieManager DEFAULT_COOKIE_MANAGER;
|
||||||
private static final int SHOW_PROGRESS = 1;
|
private static final int SHOW_PROGRESS = 1;
|
||||||
private static final int REPORT_BANDWIDTH = 1;
|
private static final int REPORT_BANDWIDTH = 1;
|
||||||
@ -269,19 +269,8 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
BANDWIDTH_METER = new DefaultBandwidthMeter(new Handler(), new BandwidthMeter.EventListener() {
|
BANDWIDTH_METER = new DefaultBandwidthMeter(new Handler(), new BandwidthMeter.EventListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onBandwidthSample(int elapsedMs, long bytes, long bitrate) {
|
public void onBandwidthSample(int elapsedMs, long bytes, long bitrate) {
|
||||||
String bw = humanReadableByteCount(bitrate, true, true);
|
|
||||||
System.out.println("Debug::::In function onBandwidthSample, elapsedMs = " + elapsedMs + " bytes = " + bytes + " bitrate = " + bitrate);
|
System.out.println("Debug::::In function onBandwidthSample, elapsedMs = " + elapsedMs + " bytes = " + bytes + " bitrate = " + bitrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String humanReadableByteCount(long bytes, boolean si, boolean isBits) {
|
|
||||||
int unit = !si ? 1000 : 1024;
|
|
||||||
if (bytes < unit)
|
|
||||||
return bytes + " KB";
|
|
||||||
int exp = (int) (Math.log(bytes) / Math.log(unit));
|
|
||||||
String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp - 1)
|
|
||||||
+ (si ? "" : "i");
|
|
||||||
return isBits ? String.format("%.1f %sb", bytes / Math.pow(unit, exp), pre) : String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user