diff --git a/src/com/upc/pbe/upcnews/Directoris.java b/src/com/upc/pbe/upcnews/Directoris.java index eb96265..f17c3b3 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -34,6 +34,7 @@ public class Directoris extends Activity implements OnClickListener { this.crearButtons(); + //Descarrega del HTML de l'index, busqueda de directoris i creacio dels botons s = ((UpcApp) getApplication()).getDesc(); HTMLParser pars = new HTMLParser(); @@ -103,22 +104,21 @@ public class Directoris extends Activity implements OnClickListener { } public void buttonClicked(Button b) { + + //Descarrega de la pàgina HTML del directori i busqueda d'un .m3u8 en ella Log.d(TAG, "Click on " + b.getText()); d = new Descarrega(url + "/" + b.getText() + "/", file, folder); String str = d.doInBackground(); - HTMLParser pars = new HTMLParser(); String urlvideo = pars.findvideo(str, url + "/" + b.getText() + "/"); - Log.d(TAG, urlvideo); - + + //Descarrega de l'arxiu .m3u8 (si existeix) i parseig if (urlvideo.equalsIgnoreCase("No s'ha trobat")) { Toast.makeText(this, "The directory " + b.getText() + " does not contain any '.m3u8' file", Toast.LENGTH_LONG).show(); } else { d = new Descarrega(urlvideo, file, folder); String m3u8 = d.doInBackground(); - - // m3u8 --> PARSE! Parser p = new Parser(); try { ArrayList m3u8parsed = p.parseFile(m3u8);