mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 14:18:34 +00:00
Fix video forwarding thumbnail display.
This commit is contained in:
parent
faafa40122
commit
a3caabcafd
@ -40,7 +40,7 @@ class DecryptableStreamLocalUriFetcher extends StreamLocalUriFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return PartAuthority.getAttachmentStream(context, uri);
|
return PartAuthority.getAttachmentThumbnailStream(context, uri);
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
Log.w(TAG, ioe);
|
Log.w(TAG, ioe);
|
||||||
throw new FileNotFoundException("PartAuthority couldn't load Uri resource.");
|
throw new FileNotFoundException("PartAuthority couldn't load Uri resource.");
|
||||||
|
@ -13,6 +13,7 @@ import org.thoughtcrime.securesms.database.DatabaseFactory;
|
|||||||
import org.thoughtcrime.securesms.providers.BlobProvider;
|
import org.thoughtcrime.securesms.providers.BlobProvider;
|
||||||
import org.thoughtcrime.securesms.providers.DeprecatedPersistentBlobProvider;
|
import org.thoughtcrime.securesms.providers.DeprecatedPersistentBlobProvider;
|
||||||
import org.thoughtcrime.securesms.providers.PartProvider;
|
import org.thoughtcrime.securesms.providers.PartProvider;
|
||||||
|
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -44,6 +45,19 @@ public class PartAuthority {
|
|||||||
uriMatcher.addURI(BlobProvider.AUTHORITY, BlobProvider.PATH, BLOB_ROW);
|
uriMatcher.addURI(BlobProvider.AUTHORITY, BlobProvider.PATH, BLOB_ROW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static InputStream getAttachmentThumbnailStream(@NonNull Context context, @NonNull Uri uri)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
String contentType = getAttachmentContentType(context, uri);
|
||||||
|
int match = uriMatcher.match(uri);
|
||||||
|
|
||||||
|
if (match == PART_ROW && MediaUtil.isVideoType(contentType)) {
|
||||||
|
return DatabaseFactory.getAttachmentDatabase(context).getThumbnailStream(new PartUriParser(uri).getPartId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return getAttachmentStream(context, uri);
|
||||||
|
}
|
||||||
|
|
||||||
public static InputStream getAttachmentStream(@NonNull Context context, @NonNull Uri uri)
|
public static InputStream getAttachmentStream(@NonNull Context context, @NonNull Uri uri)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user