Commit 117e467b9625b67a7d09e6283048267436e029a3
1 parent
9add07ed
--no commit message
Showing
3 changed files
with
14 additions
and
12 deletions
src/com/upc/pbe/upcnews/Directoris.java
... | ... | @@ -24,6 +24,7 @@ public class Directoris extends Activity implements OnItemClickListener { |
24 | 24 | private Descarrega d = new Descarrega(); |
25 | 25 | private String URL, currentFolder; |
26 | 26 | private HTMLParser parser; |
27 | + private VideoActivity videoPlayer; | |
27 | 28 | |
28 | 29 | public void onCreate(Bundle savedInstanceState){ |
29 | 30 | //Creem el layout |
... | ... | @@ -38,6 +39,7 @@ public class Directoris extends Activity implements OnItemClickListener { |
38 | 39 | parser = new HTMLParser(URL); |
39 | 40 | //Fem una llista ListView i la omplim amb la informacio trobada |
40 | 41 | ((ListView)findViewById(R.id.listView1)).setOnItemClickListener(this); |
42 | + videoPlayer = new VideoActivity(); | |
41 | 43 | this.showResources(); |
42 | 44 | } |
43 | 45 | |
... | ... | @@ -88,8 +90,11 @@ public class Directoris extends Activity implements OnItemClickListener { |
88 | 90 | * Log.d(TAG,segment[0]); |
89 | 91 | * startPlayer(segment[0],segment[1]); |
90 | 92 | */ |
91 | - String[] test = {"/sdcard/a.ts","LE TEST"}; | |
92 | - startActivity(new Intent(this, VideoActivity.class)); | |
93 | + Bundle params = new Bundle(); | |
94 | + params.putString("url", "/sdcard/a.ts"); | |
95 | + Intent mIntent = new Intent(this, VideoActivity.class); | |
96 | + mIntent.putExtras(params); | |
97 | + startActivity(mIntent); | |
93 | 98 | |
94 | 99 | } |
95 | 100 | catch (ErrorException e){ | ... | ... |
src/com/upc/pbe/upcnews/HLS.java
src/com/upc/pbe/upcnews/VideoActivity.java
... | ... | @@ -10,20 +10,20 @@ import android.widget.VideoView; |
10 | 10 | public class VideoActivity extends Activity { |
11 | 11 | |
12 | 12 | VideoView video; |
13 | - String url; | |
13 | + String url; | |
14 | 14 | |
15 | 15 | |
16 | 16 | @Override |
17 | 17 | public void onCreate(Bundle savedInstanceState) { |
18 | 18 | super.onCreate(savedInstanceState); |
19 | 19 | setContentView(R.layout.activity_video); |
20 | - url = "/sdcard/a.ts"; | |
21 | - // url = ((UpcApp) getApplication()).getDesc(); | |
22 | - | |
23 | - | |
24 | - | |
25 | - // Creacio del VideoPlayer associat a una URL | |
26 | 20 | video = (VideoView) findViewById(R.id.videoView1); |
21 | + url = this.getIntent().getExtras().getString("url"); | |
22 | + play(); | |
23 | + } | |
24 | + | |
25 | + public void play() | |
26 | + { | |
27 | 27 | video.setVideoURI(Uri.parse(url)); |
28 | 28 | video.setMediaController(new MediaController(this)); |
29 | 29 | video.start(); | ... | ... |