Commit 089e41b8b07b11486fbfe9b9e4e114c54a15284e

Authored by Imanol-Mikel Barba Sabariego
1 parent bf9662d7

Gitanada xddd

src/com/upc/pbe/upcnews/HLS.java
@@ -7,7 +7,8 @@ import android.net.TrafficStats; @@ -7,7 +7,8 @@ import android.net.TrafficStats;
7 import android.util.Log; 7 import android.util.Log;
8 8
9 //Gestor del protocol HTTP Live Streaming 9 //Gestor del protocol HTTP Live Streaming
10 -public class HLS extends UpcApp{ 10 +public class HLS
  11 +{
11 12
12 private static final String TAG = "HLS"; 13 private static final String TAG = "HLS";
13 private ArrayList<ParentList> videos; 14 private ArrayList<ParentList> videos;
@@ -31,7 +32,7 @@ public class HLS extends UpcApp{ @@ -31,7 +32,7 @@ public class HLS extends UpcApp{
31 deleteme.delete(); 32 deleteme.delete();
32 } 33 }
33 34
34 - currentQuality = this.getQuality(); 35 + currentQuality = 0;
35 currentVideo = currentQuality = currentSegment = 0; 36 currentVideo = currentQuality = currentSegment = 0;
36 this.videos = parsed; 37 this.videos = parsed;
37 endReached = false; 38 endReached = false;
@@ -69,4 +70,9 @@ public class HLS extends UpcApp{ @@ -69,4 +70,9 @@ public class HLS extends UpcApp{
69 } 70 }
70 return localFolder + seg.getURL().substring(seg.getURL().lastIndexOf("/")+1, seg.getURL().length()); 71 return localFolder + seg.getURL().substring(seg.getURL().lastIndexOf("/")+1, seg.getURL().length());
71 } 72 }
  73 +
  74 + public void setDefQuality(int q)
  75 + {
  76 + currentQuality = q;
  77 + }
72 } 78 }
73 \ No newline at end of file 79 \ No newline at end of file
src/com/upc/pbe/upcnews/VideoActivity.java
@@ -34,6 +34,7 @@ public class VideoActivity extends Activity { @@ -34,6 +34,7 @@ public class VideoActivity extends Activity {
34 }); 34 });
35 //Creem un gestor HLS, carreguem el video i iniciem la reproduccio 35 //Creem un gestor HLS, carreguem el video i iniciem la reproduccio
36 h = ((UpcApp)getApplication()).getHLS(); 36 h = ((UpcApp)getApplication()).getHLS();
  37 + h.setDefQuality(((UpcApp)getApplication()).getQuality());
37 h.loadVideo(); 38 h.loadVideo();
38 playNext(); 39 playNext();
39 } 40 }