Skip to content

Commit

Permalink
fix issues 3855 (#3856)
Browse files Browse the repository at this point in the history
* 添加機頂盒播放器和播放act

* fix #3855

---------

Co-authored-by: xiangyiwei <xiangyiwei>
Co-authored-by: Shuyu Guo <359369982@qq.com>
  • Loading branch information
xiangbill and CarGuo committed Aug 18, 2023
1 parent 1f70914 commit 91cfb71
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<activity
android:name=".PlayTVActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode"
android:screenOrientation="portrait"
android:screenOrientation="landscape"
android:theme="@style/Theme.AppCompat.Translucent" />
<activity
android:name=".ListVideoActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.transition.Transition;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;

Expand Down Expand Up @@ -195,5 +196,10 @@ public void onTransitionEnd(Transition transition) {
}
return false;
}


@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
binding.videoPlayerTv.onKeyDown(keyCode,event);
return super.onKeyDown(keyCode, event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@ public class TvVideoPlayer extends NormalGSYVideoPlayer {
public TvVideoPlayer(Context context, Boolean fullFlag) {
super(context, fullFlag);
initHandler();
getDisplay(context);
}

public TvVideoPlayer(Context context) {
super(context);
initHandler();
getDisplay(context);
}

public TvVideoPlayer(Context context, AttributeSet attrs) {
super(context, attrs);
initHandler();
getDisplay(context);
}

private Handler mHandler;
Expand Down Expand Up @@ -163,14 +166,14 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
onClickUi();
firstKeyDown();
mHandler.sendEmptyMessage(LEFT);
mHandler.sendEmptyMessageDelayed(CANCLE, 2500);
mHandler.sendEmptyMessageDelayed(CANCLE, 1500);
resetTime();
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
onClickUi();
firstKeyDown();
mHandler.sendEmptyMessage(RIGHT);
mHandler.sendEmptyMessageDelayed(CANCLE, 2500);
mHandler.sendEmptyMessageDelayed(CANCLE, 1500);
resetTime();
break;
case KeyEvent.KEYCODE_DPAD_CENTER:
Expand Down Expand Up @@ -238,9 +241,10 @@ private void keyMove() {
}
}
if (mSeekTimePosition >= getDuration() || isPlayComplete) {
mHandler.sendEmptyMessageDelayed(CANCLE, 2500);
mHandler.sendEmptyMessageDelayed(CANCLE, 1500);
mBottomContainer.setVisibility(GONE);
} else {
} else {
mChangePosition = true;
touchSurfaceMove(moveX - pointX, 0, pointY);
mBottomContainer.setVisibility(VISIBLE);
onProgressChanged(mProgressBar, (int) (mSeekTimePosition * 100 / getDuration()), true);
Expand Down Expand Up @@ -309,7 +313,7 @@ public void handleMessage(Message msg) {
//重置
public void resetTime() {
mHandler.removeMessages(CANCLE);
mHandler.sendEmptyMessageDelayed(CANCLE, 2500);
mHandler.sendEmptyMessageDelayed(CANCLE, 1500);
}

@Override
Expand Down

0 comments on commit 91cfb71

Please sign in to comment.