| | |
| | | import android.media.MediaPlayer; |
| | | import android.net.ConnectivityManager; |
| | | import android.net.NetworkInfo; |
| | | import android.support.annotation.NonNull; |
| | | import android.support.annotation.Nullable; |
| | | import android.support.v4.app.Fragment; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.fragment.app.Fragment; |
| | | |
| | | import android.util.AttributeSet; |
| | | import android.util.Log; |
| | | import android.view.GestureDetector; |
| | |
| | | import com.lcjian.library.util.common.TimeUtil; |
| | | import com.yeshi.video.player.R; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | | import java.util.List; |
| | | import java.util.Timer; |
| | | import java.util.TimerTask; |
| | | |
| | | import de.greenrobot.event.EventBus; |
| | | |
| | | import static android.content.Context.AUDIO_SERVICE; |
| | | |
| | |
| | | @Override |
| | | public void onStartTrackingTouch(SeekBar seekBar) { |
| | | isTouch = true; |
| | | mediaPlayer.pause(); |
| | | if (mediaPlayer != null) |
| | | mediaPlayer.pause(); |
| | | canHiddenController = false; |
| | | } |
| | | |
| | | @Override |
| | | public void onStopTrackingTouch(SeekBar seekBar) { |
| | | isTouch = false; |
| | | mediaPlayer.start(); |
| | | if (mediaPlayer != null) |
| | | mediaPlayer.start(); |
| | | int currentPosition = getSeconds(mediaPlayer.getCurrentPosition()); |
| | | tv_progress.setText(TimeUtil.getTimeDesc(currentPosition)); |
| | | canHiddenController = true; |
| | |
| | | } |
| | | |
| | | |
| | | public interface IVideoPlayerListener { |
| | | //暂停 |
| | | public void onVideoPause(); |
| | | |
| | | //播放 |
| | | public void onVideoPlay(); |
| | | |
| | | //下一集 |
| | | public void onNext(); |
| | | |
| | | //返回 |
| | | public void onBack(); |
| | | |
| | | //选集 |
| | | public void selectEpisode(int p, VideoEpisode episode); |
| | | |
| | | //搜藏 |
| | | public void collect(boolean collect); |
| | | |
| | | //切换清晰度 |
| | | public void changeDefinition(int p, VideoDefinition definition); |
| | | } |
| | | |
| | | //手势处理 |
| | | private class MSimpleGestureDectListener extends GestureDetector.SimpleOnGestureListener { |