VideoActivity.java 913 Bytes
package com.upc.pbe.upcnews;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.widget.MediaController;
import android.widget.VideoView;

public class VideoActivity extends Activity {

	VideoView video;
	String url;
	

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_video);
		url = "http://imanolbarba.myftp.biz/video.mp4";
		// url = ((UpcApp) getApplication()).getDesc();

		

		// Creacio del VideoPlayer associat a una URL
		video = (VideoView) findViewById(R.id.videoView1);
		video.setVideoURI(Uri.parse(url));
		video.setMediaController(new MediaController(this));
		video.start();
		video.requestFocus();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_video, menu);
		return true;
	}
}