Solved

youtube api

Posted on 2012-03-28
4
230 Views
Last Modified: 2012-04-03
using the youtube player api -
i have a handfull of youtube videos
on a web page i have them listed and represented by a thumbnail
when the thumb is clicked i want the video to load in a container div and start playing without needing to click play on the video.

all is working fine except i cannot figure out how to force it to play after it loads in the container div
0
Comment
Question by:dgrafx
  • 3
4 Comments
 
LVL 6

Expert Comment

by:bartvd
ID: 37779149
You can add ?start=1 to the URL.

For example:
<iframe width="420" height="315" src="http://www.youtube.com/embed/7ISz6BhrDXk?autoplay=1" frameborder="0" allowfullscreen></iframe>
0
 
LVL 25

Author Comment

by:dgrafx
ID: 37779527
thanks for the comment

if you look at your code you have ?start=1 in one place and ?autoplay=1 in another
so which one would i use?

I did try both and start causes the video to not display at all and autoplay allows the video to show but doesnt start playing

and i'm not using an iframe but see the following:

<div id="vcont"></div>

function playVid(v) {
      $('#vcont').youTubeEmbed(
            {
                  video                  : v,
                  width                  : 610,
                  progressBar      : true
            }
      );      
}

i've tried putting autoplay in these settings as well

thanks
0
 
LVL 25

Accepted Solution

by:
dgrafx earned 0 total points
ID: 37782485
i went in another direction using a different api where videos just start playing when they are loaded.
thanks
0
 
LVL 25

Author Closing Comment

by:dgrafx
ID: 37799999
i have no need of the original question any longer.
and since the one response was not of any use to me i am deleting the question.
to clarify - even if i had stayed with this method the answer posed was not  helpful.
I appreciate responses though.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question