mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-31 12:16:11 +00:00
committed by
Moxie Marlinspike
parent
b355991b0b
commit
7441c191a7
@@ -19,18 +19,19 @@ package org.thoughtcrime.securesms.mms;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.SmilUtil;
|
||||
import org.w3c.dom.smil.SMILDocument;
|
||||
import org.w3c.dom.smil.SMILMediaElement;
|
||||
import org.w3c.dom.smil.SMILRegionElement;
|
||||
|
||||
import ws.com.google.android.mms.pdu.PduPart;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
public class VideoSlide extends Slide {
|
||||
|
||||
@@ -41,7 +42,7 @@ public class VideoSlide extends Slide {
|
||||
public VideoSlide(Context context, Uri uri) throws IOException, MediaTooLargeException {
|
||||
super(context, constructPartFromUri(context, uri));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Drawable getThumbnail(int width, int height) {
|
||||
return context.getResources().getDrawable(R.drawable.ic_launcher_video_player);
|
||||
@@ -51,12 +52,29 @@ public class VideoSlide extends Slide {
|
||||
public boolean hasImage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasVideo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SMILRegionElement getSmilRegion(SMILDocument document) {
|
||||
SMILRegionElement region = (SMILRegionElement) document.createElement("region");
|
||||
region.setId("Image");
|
||||
region.setLeft(0);
|
||||
region.setTop(0);
|
||||
region.setWidth(SmilUtil.ROOT_WIDTH);
|
||||
region.setHeight(SmilUtil.ROOT_HEIGHT);
|
||||
region.setFit("meet");
|
||||
return region;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SMILMediaElement getMediaElement(SMILDocument document) {
|
||||
return SmilUtil.createMediaElement("video", document, new String(getPart().getName()));
|
||||
}
|
||||
|
||||
private static PduPart constructPartFromUri(Context context, Uri uri) throws IOException, MediaTooLargeException {
|
||||
PduPart part = new PduPart();
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
|
||||
Reference in New Issue
Block a user