JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 7th, 2011, 02:24 AM
doforumda doforumda is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 51 doforumda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 3 m 6 sec
Reputation Power: 5
Problem playing youtube video using javascript(jquery)

hi I am trying to play a video from youtube. What I have done so far is getting videos from my database and displaying all those videos thumbnails. So now what i want is to when i click any thumbnail it should play that video in my website. How can I do this?

Here is my code
Code:
function showResult(result) {
        $('#videosLoader').css('display','none');
            var videoId = result.split(" ");
            for(i = 0; i < videoId.length - 1; i++) {
            var vidId = $.trim(videoId[i]);
            vidLink = getScreen(vidId,"small");
            $('#videosList').append("<div class='playVid'>" + 
                                        "<img width=80 height=80 src=" + vidLink + " alt='' /> " + 
                                        "<input type='hidden' name='vidId' value='" + vidId + "' />" + 
                                    "</div>").addClass("playVid");
    }
    
    $('.playVid').click(function() {
        var val = $("input[name='vidId']").val();
        alert("val");
        $("#haveYourDefinition").append("<embed src='http://www.youtube.com/v/" + val + "&rel=1' pluginspage='http://adobe.com/go/getflashplayer' type='application/x-shockwave-flash' quality='high' width='450' height='376' bgcolor='#ffffff' loop='false'></embed>");
    });


When I click any thumbnail it does nothing. Why and please tell me how to do this? Help

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Problem playing youtube video using javascript(jquery)

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap