From 4a1fe321498dd1efd2ea5a35f2f4c2a8131cf903 Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Fri, 15 Nov 2013 15:27:52 +0000
Subject: [PATCH] SP-1002 / CCS-64: Web App for Sinergia paper - Player Bugfix

SVN: 30163
---
 .../1/as/webapps/sinergia/html/index.html     | 23 +++++++++++--------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html
index 89cf62d978e..8ef5174ed8c 100644
--- a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html
+++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html
@@ -376,16 +376,19 @@
                var idForFunc = id;
                var urlForFun = videoListURL[i];
               
-               $videoLink = $("<a>").click(function() {
-                  $("#" + idForFunc).empty();
-                  $("#"+idForFunc).flowplayer({
-									playlist: [
-										[
-											{ mp4:   urlForFun }
-										]
-									]
-								});
-
+               var $videoLink = $("<a>").click(function() {
+				  if($("#" + idForFunc).html().length > 0) {
+					  var api = $("#"+idForFunc).data("flowplayer");
+					  api.load(urlForFun);
+				  } else {
+	                  $("#"+idForFunc).flowplayer({
+	  									playlist: [
+	  										[
+	  											{ mp4:   urlForFun }
+	  										]
+	  									]
+	  								});
+				  }
                }).html("Video " + (i+1));
 
                $videoList.append($videoLink);
-- 
GitLab