package org.arkiwi.app.activity;

import org.arkiwi.app.R;

import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;
import android.app.Activity;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;

public class Vitamio extends Activity {
	@SuppressWarnings("unused")
	private String LOG_TAG = "VVDemo";
	private int mLayout = VideoView.VIDEO_LAYOUT_ZOOM;
	private VideoView mVideoView;

	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		Bundle extras = getIntent().getExtras();
		if (extras != null) {
			setContentView(R.layout.vitamio_main);

			mVideoView = (VideoView) findViewById(R.id.surface_view);
			Uri uri=Uri.parse(extras.getString("stream_url"));
			mVideoView.setVideoURI(uri);
			mVideoView.setMediaController(new MediaController(this));
			mVideoView.requestFocus();
		}
	}

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		if (mVideoView != null)
			mVideoView.setVideoLayout(mLayout, 0);
		super.onConfigurationChanged(newConfig);
	}
}
