// Path: library/src/main/java/com/veinhorn/scrollgalleryview/Constants.java
// public final class Constants {
//     public static final String ZOOM = "zoom";
//     public static final String IS_VIDEO = "isVideo";
//     public static final String URL = "url";
//     public static final String IS_LOCKED = "isLocked";
//     public static final String IMAGE = "image";
//     public static final String POSITION = "position";
// 
//     private Constants() {
//     }
// }
// 
// Path: library/src/main/java/com/veinhorn/scrollgalleryview/VideoPlayerActivity.java
// public class VideoPlayerActivity extends Activity {
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         String url = getIntent().getExtras().getString(Constants.URL);
//         setContentView(R.layout.video_fragment);
//         final VideoView videoView = (VideoView) findViewById(R.id.videoView);
//         videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
//             @Override
//             public void onPrepared(MediaPlayer mp) {
//                 View progress = findViewById(R.id.videoProgress);
//                 progress.setVisibility(View.GONE);
// 
//                 videoView.requestFocus();
//                 MediaController vidControl = new MediaController(VideoPlayerActivity.this);
//                 vidControl.setAnchorView(videoView);
//                 videoView.setMediaController(vidControl);
//                 videoView.start();
//             }
//         });
//         videoView.setVideoURI(Uri.parse(url));
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.view.View;
import android.widget.ImageView;
import com.veinhorn.scrollgalleryview.Constants;
import com.veinhorn.scrollgalleryview.VideoPlayerActivity;
        this.url = url;
        this.mId = mId;
    }

    @Override
    public boolean isImage() {
        return false;
    }

    @Override
    public void loadMedia(final Context context, ImageView imageView, SuccessCallback callback) {
        loadBitmap(context);
        imageView.setImageBitmap(mBitmap);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                displayVideo(context, url);
            }
        });
    }

    @Override
    public void loadThumbnail(Context context, ImageView thumbnailView, SuccessCallback callback) {
        loadBitmap(context);
        thumbnailView.setImageBitmap(mBitmap);
        callback.onSuccess();
    }

    private void displayVideo(Context context, String url) {
        Intent intent = new Intent(context, VideoPlayerActivity.class);
// Path: library/src/main/java/com/veinhorn/scrollgalleryview/Constants.java
// public final class Constants {
//     public static final String ZOOM = "zoom";
//     public static final String IS_VIDEO = "isVideo";
//     public static final String URL = "url";
//     public static final String IS_LOCKED = "isLocked";
//     public static final String IMAGE = "image";
//     public static final String POSITION = "position";
// 
//     private Constants() {
//     }
// }
// 
// Path: library/src/main/java/com/veinhorn/scrollgalleryview/VideoPlayerActivity.java
// public class VideoPlayerActivity extends Activity {
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         String url = getIntent().getExtras().getString(Constants.URL);
//         setContentView(R.layout.video_fragment);
//         final VideoView videoView = (VideoView) findViewById(R.id.videoView);
//         videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
//             @Override
//             public void onPrepared(MediaPlayer mp) {
//                 View progress = findViewById(R.id.videoProgress);
//                 progress.setVisibility(View.GONE);
// 
//                 videoView.requestFocus();
//                 MediaController vidControl = new MediaController(VideoPlayerActivity.this);
//                 vidControl.setAnchorView(videoView);
//                 videoView.setMediaController(vidControl);
//                 videoView.start();
//             }
//         });
//         videoView.setVideoURI(Uri.parse(url));
//     }
// }


// Path: library/src/main/java/com/veinhorn/scrollgalleryview/loader/DefaultVideoLoader.java
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.view.View;
import android.widget.ImageView;
import com.veinhorn.scrollgalleryview.Constants;
import com.veinhorn.scrollgalleryview.VideoPlayerActivity;

        this.url = url;
        this.mId = mId;
    }

    @Override
    public boolean isImage() {
        return false;
    }

    @Override
    public void loadMedia(final Context context, ImageView imageView, SuccessCallback callback) {
        loadBitmap(context);
        imageView.setImageBitmap(mBitmap);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                displayVideo(context, url);
            }
        });
    }

    @Override
    public void loadThumbnail(Context context, ImageView thumbnailView, SuccessCallback callback) {
        loadBitmap(context);
        thumbnailView.setImageBitmap(mBitmap);
        callback.onSuccess();
    }

    private void displayVideo(Context context, String url) {
        Intent intent = new Intent(context, VideoPlayerActivity.class);
        intent.putExtra(Constants.URL, url);