[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How Change  Embedded Movie using Javascript?

Posted on 2005-04-25
16
Medium Priority
?
228 Views
Last Modified: 2008-02-01
I am new to javascript. I have a page that have thumb nails of the quicktime movies i want to play. I do not want  open a new window. I want the users to click on the image and play the associated movie.  Currently, I am using a form to submit the selection to the java function, but the java function does not play the movie.  I need a way to modify the src variable so that the embedded player will start playing the selectected movie. Any help will be much appreciated.
0
Comment
Question by:dedjaran
  • 10
  • 6
16 Comments
 
LVL 25

Expert Comment

by:archrajan
ID: 13858542
Have an iframe and change the source of the iframe for each movie

<iframe src = "firstmovie" name = "ifr"></iframe>

change it like

window.frames['ifr'].src = "secondmovie" and so on...
0
 

Author Comment

by:dedjaran
ID: 13858949
Remember I am a newbie.   How would I use that for my solution?  The link provides useful info but i need to be able to play different movies in the same table. I only want to use the quictime code once
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 25

Accepted Solution

by:
archrajan earned 2000 total points
ID: 13858957
Ok, can u post the code u have?
0
 

Author Comment

by:dedjaran
ID: 13859120



<script language="JavaScript">
function playmovie()
{
return="http://./images/stories/creative/onepuff.mov"</script>

<body><form>
// This is main part
 <td height="71"><input type="IMAGE" SRC="tvmedia_r2_c2.GIF" onclick="javascript:playMovie();"></a></td>
   
</form>
*** This is inside of table*******
<OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="320"
        height="255" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
        <param name='src' value="javascript:playmovie()">
        <param name='autoplay' value="true">
        <param name='controller' value="true">
        <param name='loop' value="true">
        <EMBED src="http://./images/stories/creative/onepuff.mov" width="320" height="255" autoplay="true"
        controller="true" loop="true" pluginspage='http://www.apple.com/quicktime/download/'>
        </EMBED>
        </OBJECT>

</body
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13859168
change ur embed tag

<EMBED src="http://./images/stories/creative/onepuff.mov" width="320" height="255" autoplay="true"
        controller="true" loop="true" pluginspage='http://www.apple.com/quicktime/download/'>

to

<EMBED src="http://./images/stories/creative/onepuff.mov" width="320" height="255" autoplay="true"
        controller="true" loop="true" pluginspage='http://www.apple.com/quicktime/download/' id = "embedid">


and try to see if it works by having this

<input type = "button" value = "test" onclick = "document.getElementById('embedid').src = 'urnewmovie'">

0
 

Author Comment

by:dedjaran
ID: 13859434
the movie still does not play. it loads and it seems to submit.  Now by using "document.getelemetnbyid"  , does the player get or receive the movie to be played?
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13859463
it just loads the new src for the movie...

just getting the id of the embed tag and changing its src

0
 

Author Comment

by:dedjaran
ID: 13859516
So my embed tag doesnt need the src i.e.  <EMBED  width="320" height="255" autoplay="true"
controller="true" loop="true" pluginspage='http://www.apple.com/quicktime/download/' id = "embedid">


0
 
LVL 25

Expert Comment

by:archrajan
ID: 13859543
Nope,
the src in the embed tag is the default one,
we are just changing the src of the embed tag to play a new movie with our code...

thats what u intend to do right??
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13859548
if this is not working for u, i will post the iframe method which u can try..
0
 

Author Comment

by:dedjaran
ID: 13859573
I would like to see how the iframe method works
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13859590
why did u accept an answer now?
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13859603
0
 

Author Comment

by:dedjaran
ID: 13859701
i have an answer i can live with
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13859711
great!
0

Featured Post

Technology Partners: 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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

872 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