video bug fix

This commit is contained in:
NudeDude 2019-06-09 17:15:35 +02:00
parent 79524d94c6
commit b6327a9095
2 changed files with 11 additions and 32 deletions

View File

@ -25,10 +25,4 @@
#-renamesourcefileattribute SourceFile
-dontwarn twitter4j.**
-keep class twitter4j.** {*;}
#-dontwarn javax.**
#-keep class javax.** {*;}
#-dontwarn org.conscrypt**
#-keep class org.conscrypt** {*;}
-keep class twitter4j.** {*;}

View File

@ -36,8 +36,6 @@ import java.util.Locale;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.media.MediaPlayer.MEDIA_INFO_BUFFERING_END;
import static android.media.MediaPlayer.MEDIA_INFO_BUFFERING_START;
import static android.media.MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
@ -155,10 +153,9 @@ public class MediaViewer extends AppCompatActivity implements OnImageClickListen
break;
case VIDEO:
if (Build.VERSION.SDK_INT >= 17)
video_progress.setVisibility(VISIBLE);
case ANGIF:
case VIDEO_STORAGE:
video_progress.setVisibility(VISIBLE);
videoView.start();
break;
}
@ -218,25 +215,16 @@ public class MediaViewer extends AppCompatActivity implements OnImageClickListen
case VIDEO:
case VIDEO_STORAGE:
if (Build.VERSION.SDK_INT >= 17)
mp.setOnInfoListener(new OnInfoListener() {
@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
switch (what) {
case MEDIA_INFO_VIDEO_RENDERING_START:
video_progress.setVisibility(INVISIBLE);
return true;
case MEDIA_INFO_BUFFERING_START:
case MEDIA_INFO_BUFFERING_END:
video_progress.setVisibility(VISIBLE);
return true;
default:
return false;
}
mp.setOnInfoListener(new OnInfoListener() {
@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
if (what == MEDIA_INFO_VIDEO_RENDERING_START) {
video_progress.setVisibility(INVISIBLE);
return true;
}
});
return false;
}
});
videoController.show(0);
mp.seekTo(lastPos);
mp.start();
@ -245,9 +233,6 @@ public class MediaViewer extends AppCompatActivity implements OnImageClickListen
}
public void setImage(Bitmap image) {
float ratio = image.getWidth() / (float) width;
int destHeight = (int) (image.getHeight() / ratio);