Solved

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

Posted on 2014-03-13
2
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to dynamically set the form action using jQuery.

696 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