front_idill/src/mosaic/js/mosaic.js
changeset 79 9eff85166868
parent 77 205409da0f32
child 83 6070a596014e
child 85 b244a7bc0844
--- a/front_idill/src/mosaic/js/mosaic.js	Wed Aug 08 18:42:01 2012 +0200
+++ b/front_idill/src/mosaic/js/mosaic.js	Thu Aug 16 14:32:19 2012 +0200
@@ -203,6 +203,8 @@
 	this.isHelpIconZooming = false;
 	//Indique à l'utilisateur s'il doit retirer ses mains pour refaire une recherche par courbes.
 	this.mustTakeOutHands = false;
+	//Indique qu'une vidéo est en lecture.
+	this.isVideoReading = false;
 	
 	//Indique si on est sur une tablette.
 	this.isTablet = ('ontouchstart' in document.documentElement);
@@ -981,12 +983,6 @@
 {
 	var _this = this;
 	
-	//Si on est sur une tablette, on affiche les controls.
-	if(this.isTablet)
-	{
-		$('video').attr('controls', 'controls');
-	}
-	
 	if(this.currentMode == 'NO-USER')
 	{
 		//On peut s'approcher de la kinect.
@@ -996,7 +992,8 @@
 	//Lorsque le player est en pause (par exemple lorsque le curseur arrive à la fin de la timeline).
 	if(this.player.popcorn)
 	{
-		this.player.popcorn.listen('pause', function()
+		// this.player.popcorn.listen('pause', function()
+		this.player.popcorn.listen('ended', function()
 		{
 			//Si la pause est naturelle (fin de la timeline, dézoom, déplacement vers un voisin).
 			if(!_this.userPaused)
@@ -1024,6 +1021,12 @@
 		{
 			_this.onMarkersReady();
 		});
+		
+		//On indique à la mosaïque qu'on est en train de lire.
+		this.player.popcorn.on("timeupdate", function()
+		{
+			_this.isVideoReading = true;
+		})
 	}
 }
 
@@ -1108,6 +1111,30 @@
         format: 'ldt'
     };
     
+	var loadedWidgets;
+	
+	if(this.isTablet)
+	{
+		loadedWidgets =
+		[
+			{
+				type: "Timeline"
+			},
+			{
+				type: "TabletPlayButton"
+			}
+		];
+	}
+	else
+	{
+		loadedWidgets =
+		[
+			{
+				type: "Timeline"
+			}
+		];
+	}
+	
     var _config = {
         gui: {
             zoomTop: zoomTop - this.marginWidth*2,
@@ -1119,11 +1146,7 @@
                 metadata: _metadata
             },
             css:'./player/metadataplayer/LdtPlayer-core.css',
-            widgets: [
-                {
-                    type: "Timeline"
-                }
-            ]
+            widgets: loadedWidgets
         },
         player:{
             type: 'html5', // player type
@@ -1133,7 +1156,8 @@
             height: newSnHeight,
             width: newSnWidth,
             autostart: true
-        }
+        },
+		isTablet: this.isTablet
     };
     
     //On positionne le player.