Solved

how to see a movie in another frame using javascript

Posted on 2003-11-27
2
275 Views
Last Modified: 2010-05-18
Hi,
I have two frames on my webpage.
In frame1 I have my links : link1, link2 etc. and I would like to use javascript so that when you click on link1 in frame1 you see a video movie1 in frame2 with eventually the embed tag using windows media player. and link2 will show movie2 etc.
How can I do that?
Thank you
0
Comment
Question by:ilungachris
[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 15

Accepted Solution

by:
Timbo87 earned 250 total points
ID: 9835253
Using this frameset:
<frameset cols="134,*">
<frame name="frame1" noresize src="page1.html">
<frame name="frame2" noresize src="page2.html">
</frameset>

frame1 is the left frame and frame2 is the right frame.

page1.html looks like this:

<script language="JavaScript" type="text/javascript">
function showMovie(moviename, moviewidth, movieheight)
{
var a = "<embed src=\"" + moviename + "\" width=" + moviewidth + " height=" + movieheight+" autostart=true>"
top.frame2.document.open()
top.frame2.document.write(a)
top.frame2.document.close()
}
</script>
<a href="#" onClick = "showMovie('movie1.mpg',640,480)">Movie 1</a>
<br>
<a href="#" onClick = "showMovie('movie2.mpg',320,240)">Movie 2</a>


As long as you copy the entire script tag (from <script> to </script>), you can call the showMovie function like this:
<a href="#" onClick = "showMovie('movie1.mpg',640,480)">Movie 1</a>
file.mpg is the name of the file.
640 is the width of the movie viewer in pixels.
480 is the height of the movie viewer in pixels.
It will output this to the right frame (frame2).

If you have any other questions or if you'd like further customization or explanation, please ask.
0
 

Author Comment

by:ilungachris
ID: 9842168
thank you it works!
0

Featured Post

Industry Leaders: 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

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…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

751 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