Browse Source

Petits fix javascript pour la lecture automatique:

Sevajol Bastien 11 years ago
parent
commit
7dba3272b2

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

@@ -1155,10 +1155,15 @@ class ElementController extends Controller
1155 1155
   
1156 1156
   public function getEmbedCodeAction($element_id)
1157 1157
   {
1158
+    if (!$element_id)
1159
+    {
1160
+      return $this->jsonNotFoundResponse();
1161
+    }
1162
+    
1158 1163
     if (!($element = $this->getDoctrine()->getRepository('MuzichCoreBundle:Element')
1159 1164
       ->findOneById($element_id)))
1160 1165
     {
1161
-      throw $this->createNotFoundException();
1166
+      return $this->jsonNotFoundResponse();
1162 1167
     }
1163 1168
     
1164 1169
     return $this->jsonResponse(array(

+ 1 - 1
src/Muzich/CoreBundle/Factory/Elements/Dailymotioncom.php View File

@@ -59,7 +59,7 @@ class Dailymotioncom extends ElementFactory
59 59
       $height = $this->container->getParameter('dailymotion_player_height');
60 60
       $this->element->setEmbed(
61 61
         '<iframe frameborder="0" width="'.$width.'" height="'.$height.'" '
62
-        .'src="http://www.dailymotion.com/embed/video/'.$ref_id.'"></iframe>'
62
+        .'src="http://www.dailymotion.com/embed/video/'.$ref_id.'?autoPlay=1"></iframe>'
63 63
       );
64 64
     }
65 65
   }

+ 1 - 1
src/Muzich/CoreBundle/Factory/Elements/Deezercom.php View File

@@ -120,7 +120,7 @@ class Deezercom extends ElementFactory
120 120
       $heigth = $this->container->getParameter('deezer_player_height');
121 121
       $this->element->setEmbed(
122 122
         '<iframe scrolling="no" frameborder="0" allowTransparency="true" '
123
-        .'src="http://www.deezer.com/fr/plugins/player?autoplay=false&playlist=true'
123
+        .'src="http://www.deezer.com/fr/plugins/player?autoplay=true&playlist=true'
124 124
         .'&width='.$width.'&height='.$heigth.'&cover=true&btn_popup=true&type='.$type.'&id='.$ref_id.'&title=" '
125 125
         .'width="'.$width.'" height="'.$heigth.'"></iframe>'
126 126
       );

+ 1 - 1
src/Muzich/CoreBundle/Resources/public/js/muzich.js View File

@@ -439,7 +439,7 @@ $(document).ready(function(){
439 439
      }
440 440
      else
441 441
      {
442
-      alert('noplayer!');
442
+        // On a eu un soucis a la creation du player on dirais
443 443
      }
444 444
      
445 445
      return false;

+ 1 - 1
src/Muzich/CoreBundle/Resources/public/js/play2.js View File

@@ -29,7 +29,7 @@ function DynamicPlayer()
29 29
       return new JamendoPlayer(element_id, object_for_player, finish_callback);
30 30
     }
31 31
     
32
-    if (autoplay)
32
+    if (!autoplay && element_id)
33 33
     {
34 34
       return new GenericPlayer(element_id, object_for_player);
35 35
     }