FileDocCategorySizeDatePackage
VideoAttachmentView.javaAPI DocAndroid 1.5 API4298Wed May 06 22:42:46 BST 2009com.android.mms.ui

VideoAttachmentView

public class VideoAttachmentView extends android.widget.LinearLayout implements SlideViewInterface
This class provides an embedded editor/viewer of video attachment.

Fields Summary
private static final String
TAG
private android.widget.ImageView
mThumbnailView
Constructors Summary
public VideoAttachmentView(android.content.Context context)


       
        super(context);
    
public VideoAttachmentView(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
public static android.graphics.BitmapcreateVideoThumbnail(android.content.Context context, android.net.Uri uri)

        Bitmap bitmap = null;
        MediaMetadataRetriever retriever = new MediaMetadataRetriever();
        try {
            retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY);
            retriever.setDataSource(context, uri);
            bitmap = retriever.captureFrame();
        } catch (RuntimeException ex) {
            // Assume this is a corrupt video file.
        } finally {
            try {
                retriever.release();
            } catch (RuntimeException ex) {
                // Ignore failures while cleaning up.
            }
        }
        return bitmap;
    
protected voidonFinishInflate()

        mThumbnailView = (ImageView) findViewById(R.id.video_thumbnail);
    
public voidpauseAudio()

        // TODO Auto-generated method stub

    
public voidpauseVideo()

        // TODO Auto-generated method stub

    
public voidreset()

        // TODO Auto-generated method stub
    
public voidseekAudio(int seekTo)

        // TODO Auto-generated method stub

    
public voidseekVideo(int seekTo)

        // TODO Auto-generated method stub

    
public voidsetAudio(android.net.Uri audio, java.lang.String name, java.util.Map extras)

        // TODO Auto-generated method stub
    
public voidsetImage(java.lang.String name, android.graphics.Bitmap bitmap)

        // TODO Auto-generated method stub
    
public voidsetImageRegionFit(java.lang.String fit)

        // TODO Auto-generated method stub
    
public voidsetImageVisibility(boolean visible)

        // TODO Auto-generated method stub
    
public voidsetText(java.lang.String name, java.lang.String text)

        // TODO Auto-generated method stub
    
public voidsetTextVisibility(boolean visible)

        // TODO Auto-generated method stub
    
public voidsetVideo(java.lang.String name, android.net.Uri video)

        Bitmap bitmap = createVideoThumbnail(mContext, video);
        if (null == bitmap) {
            bitmap = BitmapFactory.decodeResource(getResources(),
                    R.drawable.ic_missing_thumbnail_video);
        }
        mThumbnailView.setImageBitmap(bitmap);
    
public voidsetVideoVisibility(boolean visible)

        // TODO Auto-generated method stub
    
public voidsetVisibility(boolean visible)

        // TODO Auto-generated method stub
    
public voidstartAudio()

        // TODO Auto-generated method stub
    
public voidstartVideo()

        // TODO Auto-generated method stub
    
public voidstopAudio()

        // TODO Auto-generated method stub
    
public voidstopVideo()

        // TODO Auto-generated method stub