From f81d71c775aaee719fb2c1a37928bf854d81b7ca Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Sun, 16 Dec 2012 18:28:57 +0000 Subject: [PATCH] --- res/xml/prefs.xml | 2 +- src/com/upc/pbe/upcnews/HLS.java | 7 ++++++- src/com/upc/pbe/upcnews/UpcApp.java | 6 ++++++ src/com/upc/pbe/upcnews/VideoActivity.java | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/res/xml/prefs.xml b/res/xml/prefs.xml index c7e05bc..2c6e7a5 100644 --- a/res/xml/prefs.xml +++ b/res/xml/prefs.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/src/com/upc/pbe/upcnews/HLS.java b/src/com/upc/pbe/upcnews/HLS.java index 19fc7ef..54a6837 100644 --- a/src/com/upc/pbe/upcnews/HLS.java +++ b/src/com/upc/pbe/upcnews/HLS.java @@ -29,11 +29,16 @@ public class HLS Log.d(TAG, "Esborrat " + files[i].toString()); deleteme.delete(); } - currentVideo = currentQuality = currentSegment = 0; + + currentVideo = currentSegment = 0; this.videos = parsed; endReached = false; } + public void setQuality(int qual){ + currentQuality = qual; + } + public void loadVideo() { // Carrega la qualitat i, a partir d'aixo, el seguent segment diff --git a/src/com/upc/pbe/upcnews/UpcApp.java b/src/com/upc/pbe/upcnews/UpcApp.java index 17931fa..e36e9d5 100644 --- a/src/com/upc/pbe/upcnews/UpcApp.java +++ b/src/com/upc/pbe/upcnews/UpcApp.java @@ -17,6 +17,12 @@ public class UpcApp extends Application implements private String desc; private final static String localPath = Environment.getExternalStorageDirectory().getPath() + "/UPC NEWS/"; private HLS h; + private int quality; + + public int getQuality(){ + quality = (int) prefs.getLong("selector", 0); + return quality; + } public String getLocalPath() { return localPath; diff --git a/src/com/upc/pbe/upcnews/VideoActivity.java b/src/com/upc/pbe/upcnews/VideoActivity.java index 62207dc..6220025 100644 --- a/src/com/upc/pbe/upcnews/VideoActivity.java +++ b/src/com/upc/pbe/upcnews/VideoActivity.java @@ -81,6 +81,7 @@ public class VideoActivity extends Activity { video.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH); //Creem un gestor HLS, carreguem el video i iniciem la reproduccio h = ((UpcApp)getApplication()).getHLS(); + h.setQuality(((UpcApp)getApplication()).getQuality()); h.loadVideo(); video.setMediaController(mc); bm = new BandwidthMeasurer(); -- libgit2 0.22.2