修改视频倒播

修改视频倒播
pull/107/head
xufulong 5 years ago
parent 7d2e5a0e52
commit 1f550fa6be
  1. 7
      app/src/main/java/com/frank/ffmpeg/activity/VideoReverseActivity.java
  2. 28
      app/src/main/res/layout/activity_video_reverse.xml
  3. 1
      app/src/main/res/values/strings.xml

@ -29,7 +29,6 @@ public class VideoReverseActivity extends BaseActivity {
private final static String VIDEO_REVERSE_PATH = ROOT_PATH + File.separator + "reverse.mp4";
private LinearLayout loading;
private VideoView videoNormal;
private VideoView videoReverse;
private FFmpegHandler ffmpegHandler;
@ -64,27 +63,23 @@ public class VideoReverseActivity extends BaseActivity {
private void initView() {
loading = getView(R.id.layout_loading);
videoNormal = getView(R.id.video_normal);
videoReverse = getView(R.id.video_reverse);
loading.setVisibility(View.GONE);
}
private void changeVisibility(){
loading.setVisibility(View.GONE);
videoNormal.setVisibility(View.VISIBLE);
videoReverse.setVisibility(View.VISIBLE);
}
private void initPlayer(){
videoNormal.setVideoPath(VIDEO_NORMAL_PATH);
videoReverse.setVideoPath(VIDEO_REVERSE_PATH);
}
/**
* 开始视频正序反序播放
* 开始视频倒播
*/
private void startPlay(){
videoNormal.start();
videoReverse.start();
}

@ -1,24 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.frank.ffmpeg.activity.VideoReverseActivity"
android:orientation="horizontal">
<VideoView
android:id="@+id/video_normal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="10dp"
android:visibility="invisible"/>
tools:context="com.frank.ffmpeg.activity.VideoReverseActivity">
<LinearLayout
android:id="@+id/layout_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:orientation="vertical">
<ProgressBar
android:layout_width="wrap_content"
@ -28,17 +19,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="视频转换中..."
android:text="@string/converting_video"
android:textColor="@color/colorPrimary"
android:textSize="18dp"/>
android:textSize="18sp"/>
</LinearLayout>
<VideoView
android:id="@+id/video_reverse"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="10dp"
android:visibility="invisible"/>
android:layout_centerInParent="true"
android:visibility="gone"/>
</LinearLayout>
</RelativeLayout>

@ -68,5 +68,6 @@
<string name="please_click_select">请点击右上角菜单选择文件</string>
<string name="wrong_audio_format">非音频文件</string>
<string name="wrong_video_format">非视频文件</string>
<string name="converting_video">正在反转视频...</string>
</resources>

Loading…
Cancel
Save