Browse Source

Anomalie #749: Pas de lecture auto quand affichage de nouveaux élements

Sevajol Bastien 11 years ago
parent
commit
9dcf938e21

+ 3 - 1
src/Muzich/CoreBundle/Controller/ElementController.php View File

396
     // On en fait un rendu graphique
396
     // On en fait un rendu graphique
397
     $html_elements = $this->render('MuzichCoreBundle:SearchElement:default.html.twig', array(
397
     $html_elements = $this->render('MuzichCoreBundle:SearchElement:default.html.twig', array(
398
       'user'        => $this->getUser(),
398
       'user'        => $this->getUser(),
399
-      'elements'    => $elements
399
+      'elements'    => $elements,
400
+      'display_autoplay' => true,
401
+      'autoplay_context' => 'home'
400
     ))->getContent();
402
     ))->getContent();
401
     
403
     
402
     // On calcule le nouveau compte de nouveaux
404
     // On calcule le nouveau compte de nouveaux

+ 5 - 2
src/Muzich/CoreBundle/Resources/public/js/autoplay.js View File

64
     players = window.players_manager.getAll();
64
     players = window.players_manager.getAll();
65
     for (var i in players)
65
     for (var i in players)
66
     {
66
     {
67
-      players[i].stopAndDestroy();
68
-      window.players_manager.remove(i);
67
+      if (i in players)
68
+      {
69
+        players[i].stopAndDestroy();
70
+        window.players_manager.remove(i);
71
+      }
69
     }
72
     }
70
   }
73
   }
71
   
74