chore(exoplayer): ensure no NPE happen
This commit is contained in:
parent
48870e38e1
commit
e33e2a9cb5
@ -215,6 +215,7 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
case SHOW_PROGRESS:
|
case SHOW_PROGRESS:
|
||||||
|
if (player != null) {
|
||||||
long pos = player.getCurrentPosition();
|
long pos = player.getCurrentPosition();
|
||||||
long bufferedDuration = player.getBufferedPercentage() * player.getDuration() / 100;
|
long bufferedDuration = player.getBufferedPercentage() * player.getDuration() / 100;
|
||||||
long duration = player.getDuration();
|
long duration = player.getDuration();
|
||||||
@ -229,6 +230,7 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
}
|
}
|
||||||
msg = obtainMessage(SHOW_PROGRESS);
|
msg = obtainMessage(SHOW_PROGRESS);
|
||||||
sendMessageDelayed(msg, Math.round(mProgressUpdateInterval));
|
sendMessageDelayed(msg, Math.round(mProgressUpdateInterval));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user