package com.minano.themovielibrary;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.MediaController;
import android.widget.VideoView;

import com.minano.themovielibrary.views.fragments.SelectorFragment;

/**
 * Created by Admin on 25/09/2016.
 */
public class PlayVideoActivity extends AppCompatActivity {

    private VideoView video;
    private MediaController controller;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_layout);

        Intent intent = getIntent();
        String videoUrl = intent.getStringExtra("url");

        video = (VideoView) findViewById(R.id.videoView);
        controller = new MediaController(this);

        video.setMediaController(controller);
        video.setVideoURI(Uri.parse(videoUrl));

        video.requestFocus();
        video.start();
    }
}
