|
|
|
|
@ -34,6 +34,7 @@ import com.fongmi.android.tv.bean.Keep; |
|
|
|
|
import com.fongmi.android.tv.bean.Live; |
|
|
|
|
import com.fongmi.android.tv.bean.Track; |
|
|
|
|
import com.fongmi.android.tv.databinding.ActivityLiveBinding; |
|
|
|
|
import com.fongmi.android.tv.event.ActionEvent; |
|
|
|
|
import com.fongmi.android.tv.event.ErrorEvent; |
|
|
|
|
import com.fongmi.android.tv.event.PlayerEvent; |
|
|
|
|
import com.fongmi.android.tv.impl.Callback; |
|
|
|
|
@ -282,6 +283,11 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick |
|
|
|
|
fetch(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkPlay() { |
|
|
|
|
if (mPlayers.isPlaying()) mPlayers.pause(); |
|
|
|
|
else mPlayers.play(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onTrack(View view) { |
|
|
|
|
TrackDialog.create().player(mPlayers).type(Integer.parseInt(view.getTag().toString())).show(this); |
|
|
|
|
hideControl(); |
|
|
|
|
@ -596,6 +602,19 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
|
public void onActionEvent(ActionEvent event) { |
|
|
|
|
if (ActionEvent.PLAY.equals(event.getAction()) || ActionEvent.PAUSE.equals(event.getAction())) { |
|
|
|
|
checkPlay(); |
|
|
|
|
} else if (ActionEvent.NEXT.equals(event.getAction())) { |
|
|
|
|
nextChannel(); |
|
|
|
|
} else if (ActionEvent.PREV.equals(event.getAction())) { |
|
|
|
|
prevChannel(); |
|
|
|
|
} else if (ActionEvent.STOP.equals(event.getAction())) { |
|
|
|
|
finish(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
|
public void onPlayerEvent(PlayerEvent event) { |
|
|
|
|
switch (event.getState()) { |
|
|
|
|
|