Skip to content

Commit

Permalink
将截图方法添加到MediaPlayerControl中,使其在controller中也能调用
Browse files Browse the repository at this point in the history
  • Loading branch information
Doikki committed May 29, 2018
1 parent a259ddd commit abe8d7e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public void setMirrorRotate(View view) {
i++;
}

public void setSpeed0_25(View view) {
ijkVideoView.setSpeed(0.25f);
public void setSpeed0_75(View view) {
ijkVideoView.setSpeed(0.75f);
}

public void setSpeed0_5(View view) {
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="播放速度:(0.25新世界)" />
android:text="播放速度:" />

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -68,16 +68,16 @@
<Button
android:layout_width="60dp"
android:layout_height="wrap_content"
android:onClick="setSpeed0_25"
android:onClick="setSpeed0_5"
android:padding="0dp"
android:text="0.25" />
android:text="0.5" />

<Button
android:layout_width="60dp"
android:layout_height="wrap_content"
android:onClick="setSpeed0_5"
android:onClick="setSpeed0_75"
android:padding="0dp"
android:text="0.5" />
android:text="0.75" />

<Button
android:layout_width="60dp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.dueeeke.videoplayer.controller;

import android.graphics.Bitmap;

public interface MediaPlayerControl {

void start();
Expand Down Expand Up @@ -41,4 +43,6 @@ public interface MediaPlayerControl {
void refresh();

void setMirrorRotation(boolean enable);

Bitmap doScreenShot();
}
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ public void setMirrorRotation(boolean enable) {
/**
* 截图,暂不支持SurfaceView
*/
@Override
public Bitmap doScreenShot() {
if (mTextureView != null) {
return mTextureView.getBitmap();
Expand Down

0 comments on commit abe8d7e

Please sign in to comment.