Commit cb06119f85fcc534170d2c89f9610a3bc6125a02

Authored by Imanol-Mikel Barba Sabariego
1 parent 35cdc54a

Bug fixed cuando se quedaba sin buffer

res/values/strings.xml
... ... @@ -29,6 +29,6 @@
29 29 <string name="alertVitamioNotInstalled">Alerta! Llibreries de Vitamio no instal·lades!</string>
30 30 <string name="alertLogoDescription">Alerta!</string>
31 31 <string name="itemType">Item type</string>
32   - <string name="buffering_text">Buffering</string>
  32 + <string name="buffering_text">Buffering...</string>
33 33  
34 34 </resources>
35 35 \ No newline at end of file
... ...
src/com/upc/pbe/upcnews/VideoActivity.java
... ... @@ -99,7 +99,7 @@ public class VideoActivity extends Activity {
99 99  
100 100 public void toggleBuffering(boolean b)
101 101 {
102   - if(b)
  102 + if(b && pd == null)
103 103 {
104 104 pd = new ProgressDialog(VideoActivity.this);
105 105 pd.setCancelable(false);
... ... @@ -123,6 +123,7 @@ public class VideoActivity extends Activity {
123 123 public void buffer()
124 124 {
125 125 buffering = true;
  126 + toggleBuffering(true);
126 127 video.suspend();
127 128 }
128 129 public void play(String path)
... ... @@ -152,7 +153,10 @@ public class VideoActivity extends Activity {
152 153 {
153 154 buffer();
154 155 }
155   - play(queue.get(0));
  156 + else
  157 + {
  158 + play(queue.get(0));
  159 + }
156 160 }
157 161 else if(currentPos < 0)
158 162 {
... ... @@ -210,7 +214,7 @@ public class VideoActivity extends Activity {
210 214 {
211 215 if(queue.isEmpty() && !ended)
212 216 {
213   - toggleBuffering(true);
  217 + buffer();
214 218 }
215 219 }
216 220  
... ...