mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-30 10:55:06 +01:00
video bug fix
This commit is contained in:
parent
79524d94c6
commit
b6327a9095
6
app/proguard-rules.pro
vendored
6
app/proguard-rules.pro
vendored
@ -26,9 +26,3 @@
|
|||||||
|
|
||||||
-dontwarn twitter4j.**
|
-dontwarn twitter4j.**
|
||||||
-keep class twitter4j.** {*;}
|
-keep class twitter4j.** {*;}
|
||||||
|
|
||||||
#-dontwarn javax.**
|
|
||||||
#-keep class javax.** {*;}
|
|
||||||
|
|
||||||
#-dontwarn org.conscrypt**
|
|
||||||
#-keep class org.conscrypt** {*;}
|
|
@ -36,8 +36,6 @@ import java.util.Locale;
|
|||||||
|
|
||||||
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
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.media.MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START;
|
||||||
import static android.view.View.INVISIBLE;
|
import static android.view.View.INVISIBLE;
|
||||||
import static android.view.View.VISIBLE;
|
import static android.view.View.VISIBLE;
|
||||||
@ -155,10 +153,9 @@ public class MediaViewer extends AppCompatActivity implements OnImageClickListen
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIDEO:
|
case VIDEO:
|
||||||
if (Build.VERSION.SDK_INT >= 17)
|
|
||||||
video_progress.setVisibility(VISIBLE);
|
|
||||||
case ANGIF:
|
case ANGIF:
|
||||||
case VIDEO_STORAGE:
|
case VIDEO_STORAGE:
|
||||||
|
video_progress.setVisibility(VISIBLE);
|
||||||
videoView.start();
|
videoView.start();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -218,23 +215,14 @@ public class MediaViewer extends AppCompatActivity implements OnImageClickListen
|
|||||||
|
|
||||||
case VIDEO:
|
case VIDEO:
|
||||||
case VIDEO_STORAGE:
|
case VIDEO_STORAGE:
|
||||||
if (Build.VERSION.SDK_INT >= 17)
|
|
||||||
mp.setOnInfoListener(new OnInfoListener() {
|
mp.setOnInfoListener(new OnInfoListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onInfo(MediaPlayer mp, int what, int extra) {
|
public boolean onInfo(MediaPlayer mp, int what, int extra) {
|
||||||
switch (what) {
|
if (what == MEDIA_INFO_VIDEO_RENDERING_START) {
|
||||||
case MEDIA_INFO_VIDEO_RENDERING_START:
|
|
||||||
video_progress.setVisibility(INVISIBLE);
|
video_progress.setVisibility(INVISIBLE);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case MEDIA_INFO_BUFFERING_START:
|
|
||||||
case MEDIA_INFO_BUFFERING_END:
|
|
||||||
video_progress.setVisibility(VISIBLE);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
videoController.show(0);
|
videoController.show(0);
|
||||||
@ -245,9 +233,6 @@ public class MediaViewer extends AppCompatActivity implements OnImageClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setImage(Bitmap image) {
|
public void setImage(Bitmap image) {
|
||||||
float ratio = image.getWidth() / (float) width;
|
float ratio = image.getWidth() / (float) width;
|
||||||
int destHeight = (int) (image.getHeight() / ratio);
|
int destHeight = (int) (image.getHeight() / ratio);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user