0

I am tryin to embed youtube in my webpage. I am a starter so i might be doing something wrong here. can any please help me on this. I have included the swobject.

<html>
   <script type="text/javascript" src="swfobject.js"></script>      
   <div id="ytapiplayer">
      You need Flash player 8+ and JavaScript enabled to view this video.
   </div>
   <script type="text/javascript">
      var params = { allowScriptAccess: "always" };
      var atts = { id: "myytplayer" };
      swfobject.embedSWF("http://www.youtube.com/v/VIDEO_ID?enablejsapi=1&playerapiid=ytplayer", 
                                 "ytapiplayer", "425", "356", "8", null, null, params, atts);
   </script>
   <script type="text/javascript">
   function onYouTubePlayerReady(playerId) {
         ytplayer = document.getElementById("myytplayer");
      }
   </script>
   <a href="javascript:void(0);" onclick="onYouTubePlayerReady();">Play</a>
   </html>

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by peter_budo
0

somilbansal, you have posted this in the wrong forum.

Please re-post this in the appropriate forum under javascript. which can be found here

0

Thread closed as there is double in JS section.

@tyson.crouch rather then requesting user to repost his question use "Flag Bad Post" option to notify moderators that post is in wrong section and assigned moderator will move it to right place

somilbansal, you have posted this in the wrong forum.

Please re-post this in the appropriate forum under javascript. which can be found here

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.