diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-09-18 21:00:00 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-09-18 21:00:00 +0200 |
commit | c0c9ce588ec60f09d0199c53a1229b722e9fa910 (patch) | |
tree | ca5dd4eb15889600ec67d0aa05ce7e445401c086 /src/main/java/de/pixart/messenger/persistance | |
parent | e582b79207817a7e49db71f5b1d03df6b0e7c8d1 (diff) |
show permanent notification while transcoding video
Diffstat (limited to 'src/main/java/de/pixart/messenger/persistance')
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/FileBackend.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java index c0cb0a7bd..ee645c50b 100644 --- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java @@ -835,6 +835,16 @@ public class FileBackend { } + public int getMediaRuntime(Uri uri) { + try { + MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); + mediaMetadataRetriever.setDataSource(mXmppConnectionService, uri); + return Integer.parseInt(mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)); + } catch (IllegalArgumentException e) { + return 0; + } + } + private Dimensions getImageDimensions(File file) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; |