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