Browse Source

Petits fix javascript pour la lecture automatique:

Sevajol Bastien 12 years ago
parent
commit
7dba3272b2

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

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

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

59
       $height = $this->container->getParameter('dailymotion_player_height');
59
       $height = $this->container->getParameter('dailymotion_player_height');
60
       $this->element->setEmbed(
60
       $this->element->setEmbed(
61
         '<iframe frameborder="0" width="'.$width.'" height="'.$height.'" '
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
       $heigth = $this->container->getParameter('deezer_player_height');
120
       $heigth = $this->container->getParameter('deezer_player_height');
121
       $this->element->setEmbed(
121
       $this->element->setEmbed(
122
         '<iframe scrolling="no" frameborder="0" allowTransparency="true" '
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
         .'&width='.$width.'&height='.$heigth.'&cover=true&btn_popup=true&type='.$type.'&id='.$ref_id.'&title=" '
124
         .'&width='.$width.'&height='.$heigth.'&cover=true&btn_popup=true&type='.$type.'&id='.$ref_id.'&title=" '
125
         .'width="'.$width.'" height="'.$heigth.'"></iframe>'
125
         .'width="'.$width.'" height="'.$heigth.'"></iframe>'
126
       );
126
       );

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

439
      }
439
      }
440
      else
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
      return false;
445
      return false;

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

29
       return new JamendoPlayer(element_id, object_for_player, finish_callback);
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
       return new GenericPlayer(element_id, object_for_player);
34
       return new GenericPlayer(element_id, object_for_player);
35
     }
35
     }