open video in new window with javascript

Hi,

I'm learning javascript and would like to add javascript to open a new window for playing video files and displaying an image similar to what shadowbox has. I'm using this as a learning tool.

For example, I'd like to add something like this:
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/7HpQTFwL_Mg&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7HpQTFwL_Mg&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

when they click on an image. The youtube video will open in a new window and play at it's original size (480x385).

I'd like to eventually add in an effect for smooth transition for opening the window.

Can someone show me some working js code for this?

Thank you,
vkimura
Victor KimuraSEO, Web DeveloperAsked:
Who is Participating?
 
MaartenHensenConnect With a Mentor Commented:
I don't think you really want to open a new "window" but an overlay.

For an overlay, check out jquery.  It makes live a lot simpeler ;).

For a new window, check out http://www.javascripter.net/faq/openinga.htm to set window properties on and off.

0
 
Victor KimuraSEO, Web DeveloperAuthor Commented:
I have this page set up:
http://tutorialref.com/test/open_new_window_js.html

Click on the "New Window" button. But the new window is showing all the extraneous window such as the address bar and the bottom area of the window.

vkimura
0
 
leakim971Connect With a Mentor PluritechnicianCommented:
0
 
leakim971Connect With a Mentor PluritechnicianCommented:
another one : http://videobox-lb.sourceforge.net/
google for video lightbox you will found a lot
0
 
Victor KimuraSEO, Web DeveloperAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.