diff --git a/src/com/upc/pbe/upcnews/VideoActivity.java b/src/com/upc/pbe/upcnews/VideoActivity.java index 5548fe5..7e2c3cf 100644 --- a/src/com/upc/pbe/upcnews/VideoActivity.java +++ b/src/com/upc/pbe/upcnews/VideoActivity.java @@ -38,6 +38,7 @@ public class VideoActivity extends Activity { boolean ended; boolean buffering; DescarregaSegment ds; + boolean videoNotPlayed; @Override @@ -53,6 +54,7 @@ public class VideoActivity extends Activity { } setContentView(R.layout.activity_video); currentPos = 0; + videoNotPlayed = false; queue = new ArrayList(); playedQueue = new ArrayList(); buffering = true; @@ -143,8 +145,15 @@ public class VideoActivity extends Activity { } if(currentPos == 0) { - playedQueue.add(queue.get(0)); - queue.remove(0); + if(!videoNotPlayed) + { + playedQueue.add(queue.get(0)); + queue.remove(0); + } + else + { + videoNotPlayed = false; + } if(ended && queue.isEmpty()) { quitPlayer(); @@ -166,6 +175,10 @@ public class VideoActivity extends Activity { public void playPrevious() { + if(currentPos == 0) + { + videoNotPlayed = true; + } if(playedQueue.isEmpty()) { play(queue.get(0)); @@ -241,7 +254,7 @@ public class VideoActivity extends Activity { Long downloaded = Long.valueOf(0); long startTime = System.currentTimeMillis(); long segmentBytes = TrafficStats.getTotalRxBytes(); - String fileName = urls[0].toString().substring(urls[0].toString().lastIndexOf("/")); + String fileName = urls[0].toString().substring(urls[0].toString().lastIndexOf("/")+1); // Iniciem la connexi� i creem els Streams try {