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

STOP click play/pause in flash player...


Greetings! First, thanks for an awesome player. Worth every penny we spent on the license.

Here's what I'm hoping to accomplish...I need to control the player 100% from javascript and have it NOT start/stop/pause when someone clicks on the actual flash player...

In other words, when someone clicks on the actual flash player have it do nothing...don't start/stop or anything.

Would this be possible? We've tried floating divs positioned over the player and trapping the click that way but it only seems to work in IE7 (ugh!).

Thanks!
Jeff B with Sales Growth Group.

37 Community Answers

JW Player

User  
1 rated :

yes, you need a trick to do this! set the flashvar _linkfromdisplay=true_

from the [url=http://www.jeroenwijering.com/extras/readme.html]readme[/url]:
_*linkfromdisplay* (true,false): You can set this flashvar to "true" to make a click on the image/video display to result in a jump to the "link" webpage. By default, a click on the display will play/pause the movie._

and in the playlist or in the _link_ flashvar:
_*link* (url): Set here the url to an external URL, downloadeable version of the file, or force-download script you can use for downloading the file. You can assign link-clicks to the display (see below), the downloadbutton and every item in a playlist_

you just place an anchor - like this: "#" voila - unresponsive screen and no jumping to links...

JW Player

User  
1 rated :

Thanks for the advice but I'm not having much luck with it :|

Mind taking a look at my code? I am building my player with SWFObject:

var so = new SWFObject('/includes/FlashObjects/mediaplayer.swf','mpl','450','300','8');
so.addParam("allowfullscreen","false");
so.addParam("wmode","opaque");
so.addParam("menu","false");
so.addVariable("file",xmlPlayList);
so.addVariable("enablejs","true");
so.addVariable("showicons","false");
so.addVariable("linkfromdisplay", "true");
so.addVariable("volume", currentVolume);
so.addVariable("logo","/Video/watermark.png");
so.addVariable("shuffle","false");
so.addVariable("javascriptid","mpl");
so.addVariable("displayheight","300");
so.addVariable("width","450");
so.addVariable("height","300");
so.addVariable("usekeys","false");
so.write('player');

And then a sample from my playlist:

<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<title>Introduction</title>
<creator>sgg</creator>
<location>file1.flv</location>
<time>39</time>
<link>#</link>
</track>
<track>
<title>Florida Law</title>
<creator>sgg</creator>
<location>file2.flv</location>
<image>/Video/SegmentCompleted.jpg</image>
<time>37</time>
<link>#</link>
</track>
</tracklist>

Even if I change the link to http://www.yahoo.com a click still starts/stops the player and doesn't launch a browser to yahoo.

I can see what your idea should do...just can't get it working! ;)

thanks again!


JW Player

User  
0 rated :

you are using the xspf format for the playlist - so the link tag should be: <info>#</info>

also remember the xml declaration as the very first line in the playlist:
<?xml version="1.0" encoding="utf-8" ?>

in this line: so.addVariable("file",xmlPlayList); you mean _playlist.xml_ ?

please see the [url=http://www.jeroenwijering.com/extras/readme.html]readme[/url] and the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/readme_playlist.htm]modified readme[/url] (on the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/]demopage[/url] - [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/javascript.htm]modified javascript[/url]) for a list of all supported playlist tags...

JW Player

User  
0 rated :

Ah! That did it! Using the info tag instead of link.

FYI, xmlPlayList was a javascript variable that I was setting above the SWFObject code.

Everything works great now..thanks!

JW Player

User  
1 rated :

Hi guys,

when I use the link# trick, I get redirected to the url where my mediaplayer is situated and the # is added...

What am I doing wrong?!

JW Player

User  
0 rated :

@Dennis,

ALL of your code or a link would be helpful. Otherwise I have to revert to my terrible *_"1000 Best Guesses"_* and we both *don't* want that.! :)

JW Player

User  
0 rated :

This only prevents the user from stopping or playing the video after it has started playing but when we first load the video, we can still click the display to play it.

Any solutions for this?

JW Player

User  
0 rated :

Like John said, it does not keep the very first click event from being handled. So if I load the page the user can still start the video by a click or if I start playing by Javascript the user can pause it once. Any further mouse clicks will use the link like described above.
Does anyone have a solution for the 1st click?

JW Player

User  
0 rated :

Hi All,
In one of my rails application, am using a flash player. I have a bit of code like this :

so.addVariable("xmlsrc", "/video_player/playlist.xml");

Instead of passing the xml source file path, I would like to pass the xml content as a string to the method.
something like so.some_method("string_containg_xml_content ");

Is there any way I can do it? Is it possible? Any help appreciated...thanks in advance...

regards,
Venkat Bagam

JW Player

User  
0 rated :

How to controll the media player in flash

ex. Play, Stop and Pause

JW Player

User  
0 rated :

Is there any way to have the link from display advance the playlist to the next track?

I've looked at XSPF elements and can't quote figure it out. Is there a related flashvar?

Also, I couldn't figure out how to start a new thread so am tacking it on here.

Wonderful software, thank you!
Kathy

JW Player

User  
0 rated :

@Kathy

you can excute a javascript from the playlist, something like this:bc.. <info>javascript:doit()</info>
and corresponding script:bc.. <script type="text/javascript">
function doit() { alert('you clicked') }
</script>
please see the (source of the) [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/javascript.htm]javascript[/url] demo (linked from the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/javascript]demopage[/url]) and the tutorial: [url=http://www.jeroenwijering.com/?item=Javascript_interaction]Javascript Interaction[/url]

note: the javascript controls only work online and you must include this code: bc.. <script type="text/javascript">
function sendEvent(swf,typ,prm) {
thisMovie(swf).sendEvent(typ,prm);
};
function getUpdate(typ,pr1,pr2,swf) {};
function thisMovie(swf) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[swf];
} else {
return document[swf];
}
};
</script>
then you can advance to the next item using this commandbc.. sendEvent('next'):

JW Player

User  
0 rated :

Thank you andersen, this seems completely understandable. Only I can't seem to get it to work.

I can't get any of the javascript working except a simple alert on click. Other sendEvents don't seem to get through. swfobject,js is on my server and referenced in the header. I don't know what I'm doing wrong.

http://dev.eebee.com and playlist at http://dev.eebee.com/eebee_playlist.xml

There's a second flash movie on the page, but it's not working even with that removed and I've tried referencing the sendEvent with the javascriptID and that doesn't work either.

Thank you for your help
Kathy

JW Player

User  
0 rated :

After writing all this below, I found the error, you need to label "var so = new SWFObject" the same as javascriptID. Instead of mpl, it needed to be intro. Phew!

---------------------------------------------------------------------------------------------------------
To make it easier, I'll paste everything here.

I am putting the code for the player into the body of the document:
bc.. <div class="coltop">
<div id="player">This text will be replaced</div>
<script type="text/javascript">
var so = new SWFObject('http://dev.eebee.com/mediaplayer.swf','mpl','232','194','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('linkfromdisplay','true');
so.addVariable('showicons','true');
so.addVariable('height','194');
so.addVariable('width','232');
so.addVariable('file','http://dev.eebee.com/eebee_playlist.xml');
so.addVariable('frontcolor','0x009999');
so.addVariable('lightcolor','0x009999');
so.addVariable('screencolor','0xFFFFFF');
so.addVariable('overstretch','true');
so.addVariable('autostart','true');
so.addVariable('repeat','true');
so.addVariable('shuffle','false');
so.addVariable('enablejs','true');
so.addVariable("javascriptid","intro");
so.write('player');
</script>
<script type="text/javascript">
function sendEvent(swf,typ,prm) {
thisMovie('intro').sendEvent(typ,prm);
};
function getUpdate(typ,pr1,pr2,swf) {};
function thisMovie('intro') {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[swf];
} else {
return document[swf];
}
};
</script>

<script type="text/javascript">
function doit() {
alert('you clicked');
};
function doit2() {
sendEvent('intro','next');
};
function doit3() {
sendEvent('next');
};
</script>
<a href="javascript:sendEvent('doit')">doit</a><br>
<a href="javascript:sendEvent('next')">next</a><br>
<a href="javascript:sendEvent('intro','next');">Play the next items</a><br>
<a href="javascript:sendEvent('intro','doit');">intro doit</a><br>
<a href="javascript:sendEvent('playitem',2)">Play the 3rd item of the playlist</a>
</div>



and the swfobject.js in in the head of the doc.
bc.. <script type="text/javascript" src="swfobject.js"></script>



I've removed the second flash player to troubleshoot, but I still can only get the alert event to work, whether it's from clicking in the flash window or from a link like the ones on the javaxcript page.

When I leave the code as is, Firefox 2 on Mac OS X gives me
Error:thisMovie(swf) has no properties

When I replace swf with 'intro', Error Console gives me
Error: missing formal parameter
function thisMovie('swf') {

Similar errors in Safari.

Everything is online. I've tried linking to the swfobject,js with absolute reference or linking to your URL, neither work.

swfobject,js doesn't seem to be loading but I don't know where to go with this anymore.

<hr>

JW Player

User  
0 rated :

After you install your *"no-stop flash"* thingie, let me/us know how to over-ride what they did. Like myself there are so many people in this world that goes into convulsions from this repititious visual flashing. If you know what it feels like to be sea-sick, *times that by 5! *

ALL you Website builders could have a different URL direction so your webpage will *NOT* load Flash images.

IF this simple request can not be, then does anyone know where there is a Website of a "class action lawsuit" to ban this "Flash Player" all together, please reference that URL here.

Thank you for helping this world progress into a safer future.

JW Player

User  
0 rated :

@fm - all you need to do is to disable or deinstall the flashplugin in you browser...

adobe flash deinstall: - http://www.adobe.com/go/tn_14157

but maybe you just want to disable it - so that you can switch it on to enjoy the occasional music piece or video...

JW Player

User  
0 rated :

Well that's really DUMB. How does that allow me/us to watch Flash Player made videos & movies?
It's the flashing advertisements that's the culprit. How do we stop that from flashing?

JW Player

User  
0 rated :

@fm - well, im so sorry, but there is no way to automatically distinguish which flash files you like and which you dont !

but it would indeed be an interesting intellectual challenge to come up with an advanced artificial intelligence browser module that could be trained to recognize your taste in webpage content and leave out/block the rest -
program something that can do that and get rich and famous !

JW Player

User  
0 rated :

Not wishing to go insane so Adobi "Flash Player" is deleted. their loss. . . (sniff - yah right)

JW Player

User  
0 rated :

Whoa, I'm so happy I found this thread, I was going crazy figuring this out. I also want my videos to just play straight through and not be able to be stopped. I used Andersen's advice and got closer than I was able to on my own. Unfortunately, now when you click on the video, although it doesn't stop at all, it also opens a new tab/window and loads the page over again. Any ideas how to make the clicks completely unresponsive. Here's my code:


function createPlayer(thePlace, theFile) {
var s = new SWFObject("mediaplayer.swf","thePlayerId","125","90","7");
s.addParam("allowscriptaccess","always");
s.addVariable("file",theFile);
s.addVariable("width","125");
s.addVariable("height","90");
s.addVariable("displayheight","90");
s.addVariable("overstretch","false");
s.addVariable("displayclick","none");
s.addVariable("showicons","false");
s.addVariable("linkfromdisplay","true");
s.addVariable("link","#");
s.addVariable("autostart","true");
s.addVariable("repeat","always");
s.write(thePlace);
}

JW Player

User  
0 rated :

whoa! nevermind just figured it out, it's:

s.addVariable("link","");

so great! sorry for bothering, I promise I'm not lazy, just really new to coding. thanks!

JW Player

User  
0 rated :

hi guys im a very begginer at this staf but i want to know how to make a adobe flash player 10 on the net to freeze or pause?
thanks

JW Player

User  
0 rated :

Actuall i am searching for script which stop the flash video before completetion or on onclick event manually.

JW Player

User  
0 rated :

Hi,

I have a SWF File (Slide show movie), and it is linked to an URL, which I cannot Edit. So, when some-one clicks on the slide show, it takes him to the linked URL.

Can any one please let me know the codes which I can used to not go to the linked url. It should be stopped without any action.

Thanks...

Kingston

JW Player

User  
0 rated :

Hi,
I am goign to download this player.
But I don't know that this is play my .exe file that contains the flv file.

SO,

I

AM

Loser.................................................................................................................................

JW Player

User  
0 rated :

What the heck am I doing wrong?

I've got the linkfromdisplay line:
so.addVariable('linkfromdisplay','true');

And I'm using the <info> tag for my playlist (http://www.midmobile.com/video/playlist.xml)

But it's still playing/pausing on click...

<script type='text/javascript'>
var so = new SWFObject('video/player.swf','ply','300','385','9','#ffffff');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('autostart','true');
so.addVariable('shuffle','true');
so.addVariable('file','video/playlist.xml');
so.addVariable('playlist','bottom');
so.addVariable('repeat','always');
so.addVariable('volume','20');
so.addVariable('playlistsize','150');
so.addVariable('linkfromdisplay','true');
so.write('videoPlayerReplace');
</script>

JW Player

User  
0 rated :

I have opened the player using the following code.

var soo = new SWFObject("player.swf", "player_"+ params['mhash'], "390", "60", "6", "#CEDAFF");
soo.addParam("FlashVars","filepath="+params['mp3path']+"&mp3="+params['mp3path']+"&showstop=1&bgcolor1=ffffff&bgcolor2=cccccc&buttoncolor=999999&buttonovercolor=0&slidercolor1=cccccc&slidercolor2=999999&sliderovercolor=666666&sliderwidth=10&sliderheight=8&textcolor=0&showvolume=1");
soo.write(boxid + '_about');
$(boxid + '_about').style.display = 'block';

Consider that there are 2 tabs.Each tab will have player to play the mp3 file.
The player got closed while clicking the stop button but if you go to another tab, the previous played mp3 file is again playing automatically.

I tried a lot to find the solution but in vein.
could you please help me?

JW Player

User  
0 rated :

how about if i'm using the shockwave flash player? would it possible to control the buttons there using jquery? thanks!

JW Player

User  
0 rated :

Seriously!!
Is there an easy way to make a animation stop/start just by clicking on it?!?!?!
Please help me!

JW Player

User  
0 rated :

bc.. <head>

<scripttype="text/javascript"src="swfobject.js"></script>

<head>


bc.. <body>

<divclass="coltop">
<divid="player">Thistextwillbereplaced</div>

<scripttype="text/javascript">
varso=newSWFObject('http://dev.eebee.com/mediaplayer.swf','intro','232','194','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('linkfromdisplay','true');
so.addVariable('showicons','true');
so.addVariable('width','232');
so.addVariable('height','194');
so.addVariable('file','http://dev.eebee.com/eebee_playlist.xml');
so.addVariable('frontcolor','0x009999');
so.addVariable('lightcolor','0x009999');
so.addVariable('screencolor','0xFFFFFF');
so.addVariable('overstretch','true');
so.addVariable('autostart','true');
so.addVariable('repeat','true');
so.addVariable('shuffle','false');
so.addVariable('enablejs','true');
so.addVariable('javascriptid','intro');
so.write('player');
</script>

<scripttype="text/javascript">
functionsendEvent(swf,typ,prm)
{
thisMovie(swf).sendEvent(typ,prm);
};

functiongetUpdate(typ,pr1,pr2,swf)
{
};

functionthisMovie(swf)
{
if(navigator.appName.indexOf("Microsoft")!=-1)
{
returnwindow[swf];
}
else
{
returndocument[swf];
}
};
</script>

<scripttype="text/javascript">
functiondoit()
{
alert('youclicked');
};

functiondoit2()
{
sendEvent('intro','next');
};
</script>

<ahref="#"onclick="javascript:doit();returnfalse;">doit</a>
<br>
<ahref="#"onclick="javascript:doit2());returnfalse;">doit2</a>
<br>
<ahref="#"onclick="javascript:sendEvent('intro','next');returnfalse;">Playthenextitem</a>
<br>
<ahref="#"onclick="javascript:sendEvent('intro','playitem',2);returnfalse;">Playthe3rditemoftheplaylist</a>
</div>

</body>

JW Player

User  
0 rated :

Help! I have searched and searched and am unable to find answer. I have a blog with an embedded mp3 player that auto starts. It can be controled by whoever is on the site but i also have links to other blogs of mine shown as buttons and it continues to play (the main blog remains open)when you go to them. The problem is it starts another player when you come back. Anyway it ends up that you are hearing several players play at once but at different places in the tracks. Don't know if that makes any sense or not but I have no idea how to correct. The player and the links are all done in separate html/java gadgets for each one. Any insite would be greatly appreciated.

Ethan Feldman

JW Player Support Agent  
0 rated :

@unveiled – Can you provide a link to where you are running this?

JW Player

User  
0 rated :

Hai it is very nice and it is very useful to me and one thing i want only for Play And Stop Action spript only i want ple send the my E-mail ID is rafiqwin88@gmail.com

JW Player

User  
0 rated :

i'm having trouble with the "#" link from display trick

here is the test site im trying to get it to work on before moving it to our main site:

http://www.zf-films.com/reel/jw2.html


can someone look at my page and tell me what im doing wrong, how i can get the code right so that when clicking on the player does nothing ?

Ethan Feldman

JW Player Support Agent  
0 rated :

The player looks fine here. If you want clicking the player to do nothing, you will have to use the v4 player and set “&displayclick=none”

JW Player

User  
0 rated :

I've added the linkfromdisplay: 'true' and link: http://someurl to flashvars, yet the video still stops when clicked instead of going to the URL defined by the "link" variable.

bc.. var vars = {
file: video_url + image_path,
autostart: true,
linkfromdisplay: true,
link: '#',
icons: 'false',
controlbar: 'none'
};
var params = { scale: 'noscale', allowfullscreen: 'false', menu: 'false', wmode: 'opaque', quality: 'high', salign: 'tl', bgcolor: '#BDBDBD'};
var attributes = { align: "center", base: "." };
swfobject.embedSWF("/jwplayer/player.swf", "content", m_width, m_height, "9.0.115", false, vars, params, attributes, outputStatus);



What am I missing?

Ethan Feldman

JW Player Support Agent  
0 rated :

linkfromdisplay is for the v3 player

it needs to be link = your link

and displayclick = link

This question has received the maximum number of answers.