Ask questions and get good answers on mb.jQuery.components

Hi, I need to use jQuery.noConflict(); , the reason is because I need to use prototype, also with other of your components works fine, just with this is not working, could you help me to fix it?

  • URL: http://euroseating.org/euroseating.com/indexTest.htm
  • Youtube Error: The URL contained a malformed video ID. Sorry about that.
  • HTML

    <html> 
    <head> 
        <link href="css/mb.YTVPlayer.css" media="all" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
        <script type="text/javascript" src="inc/jquery.metadata.js"></script>
        <script type="text/javascript" src="inc/jquery.mb.YTPlayer.js"></script>    
        <style type="text/css">
            body{
              background: url("images/06.jpg");
              margin:0;
            }
            #content{
              color:white;
              font:40px/40px Calibri;
              text-align:center;
              padding-top:120px;
              text-shadow:#666666 2px 2px 4px;
            }
            .movie{
              display:none;
            }
            .dida{
              position:fixed;
              bottom:0;
              font: 12px/14px Arial, sans-serif;
              color:white;
              padding:10px;
            }
        </style>
        <script language="javascript">  
            jQuery.noConflict();
            (function($) { 
                $(function() {
                    $(".movie").mb_YTPlayer();
                });
            })(jQuery);
        </script>
    </head> 
    <body> 
      <a href="http://www.youtube.com/watch?v=Q1lyKJYD1Mw" class="movie {opacity:.8, isBgndMovie:false, ratio:'16/9'}">video player</a>
      <a id="pippo" href="http://www.youtube.com/watch?v=Q1lyKJYD1Mw" class="movie {opacity:.8, isBgndMovie:false, ratio:'16/9'}">video player</a>
    </body> </html>
    

I added a try catch for the function onYouTubePlayerReady(playerId) Error in the line 300 var player=$("#"+playerId);, but I can not see what is exactly the error. 125

297 function onYouTubePlayerReady(playerId) {
298 try
299 {
300 var player=$("#"+playerId);
301 player.mb_setMovie();
302 }
303catch(err)
304 {
305 txt="There was an error on this page.\n\n";
306 txt+="Error description: " + err.description + "\n\n";
307 txt+="Click OK to continue.\n\n";
308 alert(txt);
309 }
310}

asked Feb 13 '11 at 13:26

Franibm's gravatar image

Franibm
113

edited Mar 13 '11 at 18:38

test page, youtube error and code added.

(Mar 12 '11 at 13:58) Franibm

Hi Matteo, I added a try catch for the function onYouTubePlayerReady(playerId) Error in the line 300 var player=$("#"+playerId);, but I can not see what is exactly the error. 297 function onYouTubePlayerReady(playerId) { 298 try 299 { 300 var player=$("#"+playerId); 301 player.mb_setMovie(); 302 } 303catch(err) 304 { 305 txt="There was an error on this page.nn"; 306 txt+="Error description: " + err.description + "nn"; 307 txt+="Click OK to continue.nn"; 308 alert(txt); 309 } 310}

(Mar 13 '11 at 18:37) Franibm

Have you tried this with any other videos? Maybe the video ID is wrong.

answered Mar 15 '11 at 14:05

cheeseisedible's gravatar image

cheeseisedible
1

Yes.. I used the same video without jQuery.noConflict(); and is working fine.. Check the url video with this video working, my problem is that I can not use jquery and prototype at the same time :S

www.euroseating.org/euroseating.com

(Mar 19 '11 at 12:58) Franibm
Your answer
toggle preview

jQuery main site - Matteo Bicocchi