Solved

How do you make an embedded youtube video play full screen with an onclick event

Posted on 2014-03-13
2
354 Views
Last Modified: 2015-06-10
Hi,

I have a youtube video and would like the video to be played at full screen when the user presses the play button.

Here is my embed code for better clarification.

<object width="420" height="315" style="background-color:#FFFFFF">
<param name="movie" value="http://www.youtube.com/v/p6hqVHb5d90?version=3&amp;hl=en_US&amp;rel=0"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/p6hqVHb5d90?version=3&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>   

Open in new window


Thanks,
0
Comment
Question by:smfmetro10
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39926753
You can't - it requires user interaction.
There is nothing in the API for it.
0
 

Author Comment

by:smfmetro10
ID: 39927194
What about using an iframe?

I don't want to adjust the user's screen, I just want to play the video full screen (whatever deminision it is in)

<iframe width="420" height="315" src="http://www.youtube.com/embed/p6hqVHb5d90?rel=1" frameborder="0" allowfullscreen></iframe>

Open in new window


When I put the url in a browser it comes up in full screen.

Is there no way to get rid of the width="420" height="315" with an onclick event?

Thanks!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

773 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