Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

this text will be replaced?


Hi,
I don't understand the following:

<script type="text/javascript" src="http://www.jeroenwijering.com/embed/swfobject.js"></script>

<div id="player">This text will be replaced</div>

What do I have to replace it with?
Is the space between the 2 lines of code necessary?

Another thing: in case I have several players on 1 webpage, do I have to use the first line of code everytime?

Kind regards,
Bart

23 Community Answers

JW Player

User  
-1 rated :

I created a one page site to try out the player, but I only get the "get flash..." message.
http://home.scarlet.be/muzieklabo/testflashspeler

In the codes generated by the setup wizzard I replaced "http://www.jeroenwijering.com/embed/" with the path to my website.

This line of code I entered before the "body" of my site:
<script type="text/javascript" src="http://home.scarlet.be/muzieklabo/testflashspeler/swfobject.js"></script>

This is the code I used for the player:
<script type="text/javascript" src="http://home.scarlet.be/muzieklabo/testflashspeler/swfobject.js"></script>

<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.</div>

<script type="text/javascript">
var so = new SWFObject('http://home.scarlet.be/muzieklabo/testflashspeler/mediaplayer.swf','mpl','120','20','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('height','20');
so.addVariable('width','120');
so.addVariable('file','http://home.scarlet.be/muzieklabo/testflashspeler/resources/dwarsfluit01.mp3');
so.addVariable('overstretch','fit');
so.addVariable('showstop','true');
so.addVariable('usefullscreen','false');
so.addVariable('shuffle','false');
so.write('player');
</script>

What am I doing wrong?
Bart

JW Player

User  
0 rated :

Your code is fine. You only need to have the script that loads swfobject.js once, in the head element of your HTML doc.

The URI to your MP3 is invalid. I get an error message from this URI: [url=http://home.scarlet.be/muzieklabo/testflashspeler/resources/dwarsfluit01.mp3]*http://home.scarlet.be/muzieklabo/testflashspeler/resources/dwarsfluit01.mp3*[/url]

Fix that, test the URI in your browser, and your player will probably work.

JW Player

User  
0 rated :

I added the script in the head element of my HTML doc, but the player still doesn't load:
http://home.scarlet.be/muzieklabo/testflashspeler

The path to the mp3 was corrected, it needed a capitol R instead of r (Resources).
http://home.scarlet.be/muzieklabo/testflashspeler/Resources/dwarsfluit01.mp3

Things work fine when using the embedded code:http://home.scarlet.be/muzieklabo/flashembed
What is the advantage of working with the script, compared to working with embedded players?

Bart

(als je liever in het Nederlands antwoord, doe gerust...)

JW Player

User  
0 rated :

I only see one thing that needs to be corrected. You have a pargraph element with an id of "player1", yet you are trying to write the player to an element with an id of "player", which doesn't exist. They must be the same:bc.. <td height=27><p id="*player1*"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this video.</div>

<script type="text/javascript">
var so = new SWFObject('http://home.scarlet.be/muzieklabo/testflashspeler/mediaplayer.swf','mpl','120','20','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('height','20');
so.addVariable('width','120');
so.addVariable('file','http://home.scarlet.be/muzieklabo/testflashspeler/Resources/dwarsfluit01.mp3');
so.addVariable('overstretch','fit');
so.addVariable('showstop','true');
so.addVariable('usefullscreen','false');
so.addVariable('shuffle','false');
so.write('*player*');
</script></td>
The main advantage of using the SWFObject method of embedding the JW Media Player is that it gives you access to the full JavaScript language for advanced uses.

If you don't need the advanced features, the object/embed method is adequate.

JW Player

User  
0 rated :

I did change "player1" to "player" but the controller still doesn't show.
Is this because of: "player" <-> 'player'? Should I use the ' ' in both cases?
http://home.scarlet.be/muzieklabo/testflashspeler/

JW Player

User  
0 rated :

Works for me. You might have an old copy in your browser's cache. Try clearing the browser's cache and reload your page.

JW Player

User  
0 rated :

Works fine now. Thanks for the support!

JW Player

User  
0 rated :

Great!!!

JW Player

User  
0 rated :

I was wondering wether it is possible to integrate your mp3 player in a Flash document. Up to now I'm using Hot Potatoes for making exercises for my pupils, but I'd like to do this in the future with Flash.
Is it possible to integrate your controller and if so, how should I do this? As I'm a music teacher, I prefer people having control over the audio, rather than just clicking on one single button.

Bart

JW Player

User  
0 rated :

Hi,
I noticed that on a PC with Internet Explorer, the players do not behave the same:
http://home.scarlet.be/muzieklabo/testflashspeler
The player on this page starts with just one click

http://home.scarlet.be/muzieklabo/flashembed
The player on this page needs to be clicked twice (first time: activation of script, second time: play)

Is there a way to avoid that double-click in the embedded version?

JW Player

User  
0 rated :

No. See the little bit about the Eolas patent on this page: [url=http://www.jeroenwijering.com/?item=Embedding_Flash]*EMBEDDING FLASH*[/url]

JW Player

User  
0 rated :

<strong></strong>por que no puedo ver un video de interes publico

JW Player

User  
0 rated :

<strong></strong>bc..

JW Player

User  
0 rated :

<strong></strong>bc..
EMBEDDING FLASH[/url]

JW Player

User  
0 rated :

<strong>[/b'overstretch','fit'bc..
]

JW Player

User  
0 rated :

HELLO

JW Player

User  
0 rated :

If you are looking for new music, soft or games, you can find it on <a href= http:// megaupload.name > megaupload</a> It is the best megaupload search engine in the internet.

JW Player

User  
0 rated :

saluuuu

JW Player

User  
0 rated :

Youonlyneedtoload*swfobject.js*once,nomatterhowmanyplayersyouhaveonthepage.

*"Thistextwillbereplaced"*willbereplacedbytheplayerwhichiswrittentothedivelementbytheJavaScript.

It'sbettertousesomethinglikethis,whichwillprompttheusertogettheFlashPlayerfromAdobeiftheydon'thaveitorwillpromptthemtoupgradeiftheyhavealowerversionthanyouhavespecified.bc.. <divid="player1">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div>

YouspecifytheminimumversionoftheFlashPlayerinthislineofcode:bc.. vars1=newSWFObject("mediaplayer.swf","mediaplayer","600","450","7");//minimumversionFlashPlayer7required
vars1=newSWFObject("mediaplayer.swf","mediaplayer","600","450","9.0.115");//minimumversionFlashPlayer9,0,115,0required

Youcanhaveasmanyspacesasyouwantbetweenthetwolinesofcode,includingzero.

Ifyouaregoingtohavemorethanoneplayer,eachplayerrequiresuniqueidentifiersinthefourplacesshowninboldandthedivelements:bc.. var*s1*=newSWFObject('mediaplayer.swf',*'mediaplayer1'*,'600','450','7');
*s1*.addVariable('javascriptid',*'mediaplayer1'*);
...othercodehere...
*s1*.write(*'player1'*);

theninthebody,whereyouwanttheplayerstoappear:bc.. <divid="player1">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div><divid="player2">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div><divid="player3">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div><divid="player4">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div>


Ifyouaregoingtousemultipleplayers,it'seasiertowraptheplayercodeinafunctionintheheadelementofyourHTMLdoc.thencallitwithanotherfunctiontoinitializetheplayers.
bc.. <head>

<scripttype="text/javascript"src="http://domain/path/swfobject.js"></script>

<scripttype="text/javascript">
functioncreatePlayer(aPlayer,aID,aImage,aFile)
{
vars1=newSWFObject('http://domain/path/mediaplayer.swf',aId,'600','450','7');
s1.addVariable('javascriptid',aId);
s1.addVariable('image',aImage);
s1.addVariable('file',aFile);
...othercode...
s1.write(aPlayer);
};

functionloadPlayers()
{
createPlayer('player1','mediaplayer1','http://domain/path/image1.jpg','http://domain/path/video1.flv');
createPlayer('player2','mediaplayer2','http://domain/path/image2.jpg','http://domain/path/video2.flv');
createPlayer('player3','mediaplayer3','http://domain/path/image3.jpg','http://domain/path/video3.flv');
createPlayer('player4','mediaplayer4','http://domain/path/image4.jpg','http://domain/path/video4.flv');
};
</script>

</head>

<bodyonload="loadPlayers();">

<divid="player1">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div>
<divid="player2">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div>
<divid="player3">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div>
<divid="player4">
<ahref="http://www.macromedia.com/go/getflashplayer">GettheFlashPlayer</a>
toseethisvideo.
</div>

</body>

</html>

YoucanusethistechniquetosendanyflashvarvaluetothecreatePlayer()function.Justmakesurethatthesequenceorderofthevariablescorrespondsinthecallandthefunction,andreplacethevaluewithavariable.
Use:bc.. s1.addVariable('image',aImage);
insteadofbc.. s1.addVariable('image',image.jpg');

JW Player

User  
0 rated :

bc..
<strong></strong>bc..
bc..
bc..
bc..

JW Player

User  
1 rated :

This player will be replaced

JW Player

User  
0 rated :

When I Open The EspnStar To Watch Cricket Live Its Sayin LiKe This Pls Help ......

Ethan Feldman

JW Player Support Agent  
0 rated :

@Salman – I would contact EspnStar about the issues with their website if you are having issues viewing videos on there.

This question has received the maximum number of answers.