diff --git a/src/com/upc/pbe/upcnews/Directoris.java b/src/com/upc/pbe/upcnews/Directoris.java index a215fb5..368f1f5 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -24,6 +24,7 @@ public class Directoris extends Activity implements OnItemClickListener { private Descarrega d = new Descarrega(); private String URL, currentFolder; private HTMLParser parser; + private VideoActivity videoPlayer; public void onCreate(Bundle savedInstanceState){ //Creem el layout @@ -38,6 +39,7 @@ public class Directoris extends Activity implements OnItemClickListener { parser = new HTMLParser(URL); //Fem una llista ListView i la omplim amb la informacio trobada ((ListView)findViewById(R.id.listView1)).setOnItemClickListener(this); + videoPlayer = new VideoActivity(); this.showResources(); } @@ -88,8 +90,11 @@ public class Directoris extends Activity implements OnItemClickListener { * Log.d(TAG,segment[0]); * startPlayer(segment[0],segment[1]); */ - String[] test = {"/sdcard/a.ts","LE TEST"}; - startActivity(new Intent(this, VideoActivity.class)); + Bundle params = new Bundle(); + params.putString("url", "/sdcard/a.ts"); + Intent mIntent = new Intent(this, VideoActivity.class); + mIntent.putExtras(params); + startActivity(mIntent); } catch (ErrorException e){ diff --git a/src/com/upc/pbe/upcnews/HLS.java b/src/com/upc/pbe/upcnews/HLS.java index a5353ad..6d476eb 100644 --- a/src/com/upc/pbe/upcnews/HLS.java +++ b/src/com/upc/pbe/upcnews/HLS.java @@ -2,9 +2,6 @@ package com.upc.pbe.upcnews; import java.util.ArrayList; -import android.content.ComponentName; -import android.content.Intent; -import android.net.Uri; import android.util.Log; //Gestor del protocol HTTP Live Streaming diff --git a/src/com/upc/pbe/upcnews/VideoActivity.java b/src/com/upc/pbe/upcnews/VideoActivity.java index 702e2ed..91c394e 100644 --- a/src/com/upc/pbe/upcnews/VideoActivity.java +++ b/src/com/upc/pbe/upcnews/VideoActivity.java @@ -10,20 +10,20 @@ import android.widget.VideoView; public class VideoActivity extends Activity { VideoView video; - String url; + String url; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_video); - url = "/sdcard/a.ts"; - // url = ((UpcApp) getApplication()).getDesc(); - - - - // Creacio del VideoPlayer associat a una URL video = (VideoView) findViewById(R.id.videoView1); + url = this.getIntent().getExtras().getString("url"); + play(); + } + + public void play() + { video.setVideoURI(Uri.parse(url)); video.setMediaController(new MediaController(this)); video.start();