How would I go about preventing autoplay on this before it being clicked on?

How would I go about preventing autoplay on this before it being clicked on?
http://www.cssdesk.com/gQbKg

<a style="display:inline-block; width: 100px; height: 24px; cursor: pointer; background-color:#ffffff; color:#000000; 
border-left: 100px solid #00ffff;border-right: 100px solid #ff00ff;border-radius: 50px;"> </a>
</div>

<div id="myObj" style="display: none;">
<iframe src="http://sv.wargaming.fm:8051/128" width="300" height=28" scrolling="no">

</iframe>

</div>

Hi there asasass,

check out the attached zip file which will show you
how to start and pause your radio program. :sunglasses:

asasass.zip (1.7 KB)

coothead

As far as I know, if you embed something from another site in an iframe like this, you have no control over how it behaves.

Hi there TechnoBear,

the example in my attachment does not employ an “iframe element”, :mask:

coothead

2 Likes

oh, then that won’t help then.

Unfortunately, I’m using mobile at the moment, and can’t open the zip file. I was just commenting on the OP’s code.

What won’t help, @asasass? @coothead’s code should solve your problem.

1 Like

Of course it works, squire. :sunglasses:

If it didn’t, then I would not have posted the attachment would I? :ok:

coothead

2 Likes

Have you tried the code that I gave you yet?

Or are you just going to ignore it?

coothead

That one uses javascript, doesn’t it?

I have not looked at @coothead’s code, yet, but what if it does use JavaScript? Is that a show-stopper? Why would JavaScript be a problem?

I’m just not familiar with that type of code. I’m just learning css.

You should start by learning HTML and getting your content correctly coded as a list.

2 Likes

That’s a fair point, but in this instance, you don’t need to do anything with the JavaScript, beyond link to it in your HTML. It works perfectly. (I’m back on my PC and have been able to test it.)

It is not possible to do what you want with the code you first posted, so one way or another, you need to rethink your approach.


You have started multiple threads here, all of which seem to be attempting to do much the same thing, using various different approaches, most of which you seem to have only a vague understanding of. I have the impression that you’re taking pieces of code found elsewhere on the Internet and trying to adapt them, without a basic understanding of how they work. It doesn’t seem to me to be a productive use of your time (or ours) to constantly go over the same ground with no sign of progress.

If you have a definite project in mind - a particular kind of site or page you want to build - a more sensible approach would be to outline clearly what it is you’re trying to achieve, and then allow the vastly-knowledgeable members here to guide you in doing it the right way. You would learn far more by that method than you will by continually tinkering with outdated code and ignoring sound advice.

3 Likes

Hi there asasass,

Check out the attachment which has a totally
non-javascript solution to your radio problems. :sunglasses:

radio-stations.zip (7.8 KB)

coothead

Thanks, I already know this way, and, html5 audio is automatically disabled on internet explorer which I don’t use, but which I would want it to work on every browser.

I’m already using one, and it’s called JW Player v. 5.10.2295

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.