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
11●3
test page, youtube error and code added.
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}