Code example for MediaMetadataRetriever

Methods: getFrameAtTime, release, setDataSource

0
    public void setTextVisibility(boolean visible) {
        mTextView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
    } 
 
    public void setVideo(String name, Uri video) {
        MediaMetadataRetriever mp = new MediaMetadataRetriever();
        try { 
            mp.setDataSource(getContext(), video);
            mImageView.setImageBitmap(mp.getFrameAtTime(1000));
        } finally { 
            mp.release();
        } 
    } 
 
    public void setVideoVisibility(boolean visible) {
        // TODO Auto-generated method stub 
    } 
 
    public void stopAudio() { 
        // TODO Auto-generated method stub 
    }