Skip to content

Commit

Permalink
Add additional log information
Browse files Browse the repository at this point in the history
  • Loading branch information
esilverberg committed Nov 6, 2018
1 parent 08992ee commit 6d43fe4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions android/src/main/java/com/perrystreetsoftware/RNRtmpView.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,10 @@ public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
Log.i(APP_NAME, String.format("onPlayerStateChanged: %b %d", playWhenReady, playbackState));

if (playbackState == Player.STATE_ENDED) {
RNRtmpView.this.onPlaybackStateChanged(RNRtmpPlaybackState.Stopped);

mPlayer.seekTo(0);
mPlayer.setPlayWhenReady(true);

RNRtmpView.this.onPlaybackStateChanged(RNRtmpPlaybackState.Stopped);
} else if (playbackState == Player.STATE_READY) {
mPlayer.seekTo(0);

Expand Down Expand Up @@ -410,6 +409,8 @@ public void onPlaybackStateChanged(RNRtmpPlaybackState playbackState) {
public void onPlaybackStateChanged(RNRtmpPlaybackState playbackState, Throwable error) {
WritableMap event = Arguments.createMap();
event.putString("state", playbackState.getFieldDescription());
event.putInt("playback_state", mPlayer.getPlaybackState());
event.putBoolean("play_when_ready", mPlayer.getPlayWhenReady());

if (error != null) {
event.putString("error", error.toString());
Expand Down

0 comments on commit 6d43fe4

Please sign in to comment.