Commit 74d6ee79778ebf0875921ed6442fef8f519bf343
1 parent
4a4152c1
--no commit message
Showing
1 changed file
with
5 additions
and
5 deletions
src/com/upc/pbe/upcnews/Directoris.java
... | ... | @@ -34,6 +34,7 @@ public class Directoris extends Activity implements OnClickListener { |
34 | 34 | |
35 | 35 | this.crearButtons(); |
36 | 36 | |
37 | + //Descarrega del HTML de l'index, busqueda de directoris i creacio dels botons | |
37 | 38 | s = ((UpcApp) getApplication()).getDesc(); |
38 | 39 | |
39 | 40 | HTMLParser pars = new HTMLParser(); |
... | ... | @@ -103,22 +104,21 @@ public class Directoris extends Activity implements OnClickListener { |
103 | 104 | } |
104 | 105 | |
105 | 106 | public void buttonClicked(Button b) { |
107 | + | |
108 | + //Descarrega de la pàgina HTML del directori i busqueda d'un .m3u8 en ella | |
106 | 109 | Log.d(TAG, "Click on " + b.getText()); |
107 | 110 | d = new Descarrega(url + "/" + b.getText() + "/", file, folder); |
108 | 111 | String str = d.doInBackground(); |
109 | - | |
110 | 112 | HTMLParser pars = new HTMLParser(); |
111 | 113 | String urlvideo = pars.findvideo(str, url + "/" + b.getText() + "/"); |
112 | - | |
113 | 114 | Log.d(TAG, urlvideo); |
114 | - | |
115 | + | |
116 | + //Descarrega de l'arxiu .m3u8 (si existeix) i parseig | |
115 | 117 | if (urlvideo.equalsIgnoreCase("No s'ha trobat")) { |
116 | 118 | Toast.makeText(this, "The directory " + b.getText() + " does not contain any '.m3u8' file", Toast.LENGTH_LONG).show(); |
117 | 119 | } else { |
118 | 120 | d = new Descarrega(urlvideo, file, folder); |
119 | 121 | String m3u8 = d.doInBackground(); |
120 | - | |
121 | - // m3u8 --> PARSE! | |
122 | 122 | Parser p = new Parser(); |
123 | 123 | try { |
124 | 124 | ArrayList<ParentList> m3u8parsed = p.parseFile(m3u8); | ... | ... |