LongTail Video is now JW Player - New Name, Same Passion For Video

Close

JW Player Forums

CATEGORY:

/

How to put more than one video on single page

23 replies [Last post]

I am trying to put more than one video on a web page. But after putting the 1st video on the page when I try to put the second one , the 1st one mysteriously gets replaced with the 2nd. That means second video does not show at the place in the web page where I put it , but somehow comes in the position of the first one ( replaces it ). Thus only one video remains on the page.

I have checked the script tags to see if they are not broken. Can someone please let me know if there is some trick to put more than one video on a page ? What am I missing ? Thanking you in advance for your kind help ...

Details :

Web page http://www.glad2teach.co.uk/fast_maths_calculation_tricks_copy(2).htm

Script for Video 1

<script type="text/javascript" src="/embed/swfobject.js"></script> <div id="player">This text will be replaced</div> <script type="text/javascript">var so = new SWFObject('/embed/player.swf','mpl','640','500','9');so.addParam('allowscriptaccess','always');so.addParam('allowfullscreen','true');so.addParam('flashvars','&author=Glad2teach.co.uk&description=Base 50&file=http://www.glad2teach.co.uk/video_flv/NewCode__Base50.flv&image=http://www.glad2teach.co.uk/images/s...');so.write('player');</script>

Script for Video 2

<script type="text/javascript" src="/embed/swfobject.js"></script> <div id="player">This text will be replaced</div> <script type="text/javascript">var so = new SWFObject('/embed/player.swf','mpl','640','500','9');so.addParam('allowscriptaccess','always');so.addParam('allowfullscreen','true');so.addParam('flashvars','&author=Glad2teach.co.uk&description=Base 50&file=http://www.glad2teach.co.uk/video_flv/NewCode__Base50.flv&image=http://www.glad2teach.co.uk/images/s...');so.write('player');</script>

Correction the script for video 1 is

<script type="text/javascript" src="/embed/swfobject.js"></script> <div id="player" align="center">.</div> <script type="text/javascript">var so = new SWFObject('/embed/player.swf','mpl','640','500','9');so.addParam('allowscriptaccess','always');so.addParam('allowfullscreen','true');so.addParam('flashvars','&author=Glad2teach.co.uk&description=Faster Multiplication&file=http://www.glad2teach.co.uk/video_flv/NewCode__Multi_with-11.flv&image=http://www.glad2teach.co.uk/i...');so.write('player');</script>

you just need to give the player placeholders unique IDs

...
<div id="player1" align="center">.</div>
...
so.write('player1');
...
...
<div id="player2" align="center">.</div>
...
so.write('player2');
...

Dear Anderson ,

THANK YOU so much for your prompt and precise reply. Your tip worked like magic ....

Here's my code now exactly how would i use your code to setup the two players? I am a real noob at this.

<div id="Layer1"><p id='preview'>The player will show in this paragraph</p>

<script type='text/javascript' src='swfobject.js'></script>
<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player','400','300','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=funnydance.flv&autostart=true');
s1.write('preview');
</script>
</html>

Only needed once in the head element of your HTML doc.

<script type='text/javascript' src='swfobject.js'></script>

In the body element of your HTML doc.

<div id="preview1">
  <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
</div>
<div id="preview2">
  <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
</div>

<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player1','400','300','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=funnydance.flv&autostart=true');
s1.write('preview1');
</script>

<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player2','400','300','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=funnydance.flv&autostart=true');
s1.write('preview2');
</script>

Your the man, thanks

@Ed,

You're welcome. Good Luck!

                                                                                            :D

Can you take a blank page in Dreamweaver and paste in the code from the JW setup wizard only? When i try it i get nothing. If i take the code from the player, that's on the first page it works, but not from the wizard. I thought they were the same.Do you have to us both, man i am just learning any help to understand this would be greatly appreciated.

@Ed
do you correct the file paths when you paste the code from the wizard into the dreaded wysiwyg editor ?
(the paths of the wizard code are all relative and pointing to subfolders on the longtail site !)

the safest is to use full paths (including http://www...) to all files, at least until you have seen everything work

you can check for the presence of each file by pasting the url address into the browser address line and then pressing the enter button - then it should start to download and it is proven to you that it is actually there

thanks for all your help, you where right i didn't have the complete file paths correct. Another thing does the player have to reside in the same folder as the .flv file?

@Ed - that is the simplest, because then you need no paths at all - but if you use full paths then the files can be anywhere on the web...

how can i add video on a web page? can u tell me the steps,.... thankz

@hay - please see - http://www.longtailvideo.com/support/tutorials/Embedding-Flash

and please also review the first few sections of - http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_TEC.html
in particular - http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_TEC.html#apage

please note that the examples use swfobject v.2.1 - http://code.google.com/p/swfobject/

the readme.html and the wizard uses swfobject v.1.5 (Dec. 26, 2008)
http://www.longtailvideo.com/support/jw-player-setup-wizard
make sure to try some settings experiments with the wizard, and note the two types of code it produces...

I am actually trying to have my 1st video replaced by my 2nd. The 1st is part of my header & shows up on my main page. Then on secondary pages, the secondary video replaces the header video. It works the majority of the time but not on all machines. Is there a better way to do this? I've described it w/ code in this post -

http://www.longtailvideo.com/support/forum/JavaScript-Interaction/15562/2nd-player-to-replace-1st-pl...

Thanks.

Can anybody tell me how to put a wmv video in my website.

I already upload the wmv in my FTP.

Thanks to all.

happyholidays@intnet.mu

www.happyholidays.mu

Whoops - that's a bit too off-topic for me...

Thanks Andersen
I was having the same problem and followed your simple fix to rename the players with numbrs in the name it it worked like a charm

Wow this worked thanks!

Is it possible to add more than one video to play after the another inside the same player.
I have used the same code as sameer has asked from his first question.

Thanks in advance

Use a playlist.

Great player! How do I change this from the video player to the audio player? I can't figure it out!

<script type='text/javascript' src='swfobject.js'></script>

<div id="preview1">
<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
</div>
<div id="preview2">
<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
</div>

<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player1','400','300','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','opaque');
s1.addParam('file=http://bloodofazombie.com/mp3/boaz_abc_no_rio_wfade_stereo.mp3&autostart=false');
s1.write('preview1');
</script>

<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player2','400','300','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('wmode','opaque');
s1.addParam('flashvars','file=http://bloodofazombie.com/mp3/boaz_rockstarbar.mp3&autostart=false');
s1.write('preview2');
</script>

Hi Matthew,

As soon as you load an Mp3 file, the player is an audio player. You don't have to change anything else.

Best,
-Ethan

Still don't have the new JW Player? Get It Here