Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Plugin support
  3. » smd_slimbox

#313 2007-11-05 23:42:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,475
Website GitHub

Re: smd_slimbox

vittorio wrote:

Seems that your plugin is causing the error on internet explorer. Still working perfectly in ff, though.

I assume you’re referring to the odd “Operation aborted” message in IE6 (not sure about IE7, I don’t have it because I don’t use IE ever). Remember a couple of posts ago I mentioned removing the swfobject script. Try removing that and see if the problem goes away.

Alternatively, try removing (hiding) the article that contains the embedded youtube video, and reloading the page. Does the problem go away then? wouaren had a similar issue waaay back on page 1 or 2 of this thread and I think the outcome was that mootools or slimbox.js just plain didn’t agree with the <embed> tag in Internet Explorer. Kind of ironic given that the only reason to use the embed tag is to please Internet Explorer’s broken <object> tag :-p

Since then I’ve noticed it’s not always embed, so perhaps that’s unduly harsh. My guess – and it is only a guess because wouaren fixed it himself and I cannot remember what he did (he may know, ask him, and if you find out, post it here so I know the answer for future!) – is that there’s some odd interaction between either swfobject or <embed> or <object> and IE, possibly when mootools is loaded.

I have no idea what it is or why it happens, just that it does and that (usually) by not using both embed AND object, or by moving the <script src="swfobject.js"> line somewhere else in the page flow (above mootools.js? below it? bottom of the page?) sometimes fixes it. Sometimes not, it’s maddening and I’ve never found the definitive answer :-(

In fact I had it the other day with smd_random_banner using a plain <object> tag (no embed, no swfobject). The first time the page loads in IE6, I get the “operation aborted” dialog box, I get dumped to a ‘page cannot be displayed’ screen but if I click Back, then the page renders fine and plays the video. Go figure! Might even be a bug in that particular version of the Flash player (8?) because the same page just kills Konqueror on Linux; shuts the browser down, but works fine in Firefox on Linux – and that’s using exactly the same Flash shared library code!

So unfortunately I don’t know why it does it. wouaren got round it somehow, he might be your best bet, but please post back here if you find an answer; this “feature” is annoying me beyond belief! Of course, if it is the plugin then I’ll fix it, but tracking down the exact circumstances it happens is the key. Sorry I can’t be any more help right now.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#314 2007-11-06 10:18:18

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: smd_slimbox

Bloke wrote:

Alternatively, try removing (hiding) the article that contains the embedded youtube video, and reloading the page. Does the problem go away then? wouaren had a similar issue waaay back on page 1 or 2 of this thread and I think the outcome was that mootools or slimbox.js just plain didn’t agree with the <embed> tag in Internet Explorer. Kind of ironic given that the only reason to use the embed tag is to please Internet Explorer’s broken <object> tag :-p

It seems to be exactly that, not the swfobject . Moving the <script src="swfobject.js"> somewhere else in the page, didn’t seem to solve anything. Now, with that script hidden, the error shows up on every page containing an embed or object tag. Look: main page is working now (on IE), while a post with a youtube video is not.

Follow up: I turned on kml_flashembed and the swfobject script, and get the error on a page with a flash movie too.

Anyway, I’ll email I’ve already emailed wouaren, asking what he did to fix this thing, and will keep you informed.

Cheers,
Vittorio

Last edited by vittorio (2007-11-06 10:36:14)


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

#315 2007-11-06 10:51:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,475
Website GitHub

Re: smd_slimbox

vittorio wrote:

I turned on kml_flashembed and the swfobject script, and get the error on a page with a flash movie too.

Freaky! So it happens with pure flash too. How very bizarre. Yet on this site where I’ve used an embedded object tag, both mootools and slimbox are loaded (though not used) and it plays fine in IE (btw, I know there’s a js error I haven’t located yet).

Clearly something is different between your page and mine that’s causing the conflict. I guess all we (you :-) can do for now is keep prodding at it, maybe with wouaren’s help, commenting stuff out and trying to figure exactly what combination of scripts/filters/plugins makes IE cry.

will keep you informed.

Many thanks. I’m just trying to add simple swfobject.js support into smd_random_banner (nowhere near as glorified as kml_flashembed, but enough so simple random movies can be played back using the library if you wish).

As I test that I may stumble across something.

Edit: Just chatted to wouaren. He suggested looking at this site which details the exact problem and suggests a workaround. In case the site ever goes down, I quote:

The problem is you can’t append to the body element from script that isn’t a direct child to the body element. It can be fixed simply by putting defer=”defer” in the script tag. According to the W3C, the defer attribute “… provides a hint to the user agent that the script is not going to generate any document content (e.g., no ‘document.write’ in javascript) and thus, the user agent can continue parsing and rendering” … The fix, as stated in Eoghan’s post, was to put defer=“defer” in the script tags whenever I was using SWFObject.

Maybe try that? And if it works, we both owe wouaren a pint :-)

Last edited by Bloke (2007-11-06 11:04:48)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#316 2007-11-06 13:11:30

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: smd_slimbox

Bloke wrote:

Just chatted to wouaren. He suggested looking at this site which details the exact problem and suggests a workaround.

I think I’m missing something… If I have a youtube video code: <object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/JMQ21p93JZc&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/JMQ21p93JZc&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object> where should I put the defer=“defer” attribute?

And, for other flash movies, should I put it as an attribute into the <txp:kml_flashembed> tag, or directly inside the plugin, thus hacking it? I tried the first, but it didn’t work…

Last edited by vittorio (2007-11-06 13:12:43)


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

#317 2007-11-06 13:40:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,475
Website GitHub

Re: smd_slimbox

vittorio wrote:

If I have a youtube video code: <object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/JMQ21p93JZc&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/JMQ21p93JZc&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object> where should I put the defer=“defer” attribute?

Ah, right, I see. Sorry to confuse you! You use defer=“defer” if you are using swfobject. It goes in the javascript tag like this:

<script type="text/javascript" defer="defer">
so = new SWFObject("mymovie.swf" ...);
so.addParam("blah", "moreblah");
so.write("flashcontent");
</script>

I recently found out that if you are just using the <object> tag, the nested <embed> tag is unnecessary. It’s a legacy hangover from the way older browsers abused the <object> tag but should now be safe to remove. wouaren seems to think you can get away without it, even on IE6. This is my experience too, having just tried it out; with embed = IE crash; without embed = IE fine. Now, there may be a reason for leaving it in that I don’t know of, but perhaps that is what is causing the problem in this case? It can’t hurt to try your page without it and see what happens.

should I put it as an attribute into the <txp:kml_flashembed> tag, or directly inside the plugin

Unfortunately, from my 3-minute glance over kimili’s code, it doesn’t appear that defer=“defer” can be added via the plugin :-( I may have missed something but the only way I can see of doing it is to hack the plugin: everywhere there’s a <script src="..."> tag, add the ‘defer’ bit inside it.

Long term, I wonder if it might be worth talking to kimili and sending any relevant links over. He can then decide if it is in his interests to either add a defer option to the plugin (or make it defer by default), and maybe remove the nested <embed> tag. Or perhaps offer a plugin option to have it taken out/added.

What do you think?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#318 2007-11-06 14:31:41

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: smd_slimbox

Bloke wrote:

I recently found out that if you are just using the <object> tag, the nested <embed> tag is unnecessary. It’s a legacy hangover from the way older browsers abused the <object> tag but should now be safe to remove. wouaren seems to think you can get away without it, even on IE6. This is my experience too, having just tried it out; with embed = IE crash; without embed = IE fine. Now, there may be a reason for leaving it in that I don’t know of, but perhaps that is what is causing the problem in this case? It can’t hurt to try your page without it and see what happens.

So I tried to modify the code of an embedded video removing the <embed> and leving the rest, which now is <object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/JMQ21p93JZc&rel=1"></param><param name="wmode" value="transparent"></param></object>, but now the video isn’t shown anymore, either on IE or FF. Good news is: no more of that odd error :-)

everywhere there’s a <script src="..."> tag, add the ‘defer’ bit inside it.

Found it twice, and added. Again, no video shown (with IE, while on FF works), but at least no error :-)
Off course, this issue is still far from being solved…

Last edited by vittorio (2007-11-06 14:35:39)


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

#319 2007-11-06 14:49:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,475
Website GitHub

Re: smd_slimbox

vittorio wrote:

<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/JMQ21p93JZc&rel=1"></param><param name="wmode" value="transparent"></param></object>, but now the video isn’t shown anymore

Yeah, you need the data attribute to tell the object tag where the file is located :-) The <param name="movie"> is just for IE’s benefit. Here are a lot of examples. Also see my entry in the random banner docs about it.

Last edited by Bloke (2007-11-06 14:51:33)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#320 2007-11-06 15:12:54

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: smd_slimbox

Bloke wrote:

Yeah, you need the data attribute to tell the object tag where the file is located :-) The <param name="movie"> is just for IE’s benefit. Here are a lot of examples. Also see my entry in the random banner docs about it.

Let’s see… now I have <object width="425" height="355" data="http://www.youtube.com/v/JMQ21p93JZc&rel=1"><param name="movie" value="http://www.youtube.com/v/JMQ21p93JZc&rel=1"></param><param name="wmode" value="transparent"></param></object>. Result? It works on FF, but it doesn’t in IE, which shows an empy box sized with the values passed in the height and width attributes.

I’m sorry that I’m not such an expert, otherwise I would have fixed it myself. But, in my personal case, it is more important to fix the display of the youtube videos, as I make quite a big use of them on my site. I was indeed wondering about removing kimili’s plugin (and the swfobject.js call in the <head> section) once for all, as I have no more than two or three flash movies that make use of it… But this wouldn’t solve the problem with youtube videos… Maybe trying with another plugin?


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

#321 2007-11-06 15:35:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,475
Website GitHub

Re: smd_slimbox

vittorio wrote:

now I have @<object width=“425” height=“355” data=“http://www.youtube.com/v/JMQ21p93JZc&rel=1”> Result? It works on FF, but it doesn’t in IE, which shows an empy box

You’re getting closer then! How about adding the mandatory type attribute to the object tag as well? (type="application/x-shockwave-flash" ?) and if IE still doesn’t play ball, look at adding a classid= attribute as well? Under more complicated cases it mentions how to embed a quicktime movie for IE using the clsid: syntax. I can only assume that for a YouTube .flv/flash player plugin there must be a specific activeX control with a given class id. I don’t know what it is, but google might be able to find one for you.

FYI:
  • mov is clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B
  • media player is clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6
and I think (but am not sure) that:
  • flash is clsid:D27CDB6E-AE6D-11cf-96B8-444553540000

I’m sorry that I’m not such an expert

Hehehe, nor am I! I’m just making it up as I go along and hacking stuff together until it (sort of) works :-) I think it’s the best we can hope for with these browsers all doing stuff in their own unique little way.

btw, you may also like to look up conditional comments for IE. You might be able to put a specific <object> tag for IE and one for “other browsers”. Look at the ‘get embed code’ links on this random page I found and see how they do it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#322 2007-11-06 16:05:08

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: smd_slimbox

Bloke wrote:

How about adding the mandatory type attribute to the object tag as well? (type="application/x-shockwave-flash" ?)

Ok, now it works! But, if I understood correctly, from now on I will not be able just to catch the <embed> code from youtube pages and paste it right into my article… it was so quick… :-)


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

#323 2007-11-06 16:21:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,475
Website GitHub

Re: smd_slimbox

vittorio wrote:

Ok, now it works!

Yay! Got there in the end :-p

But, if I understood correctly, from now on I will not be able just to catch the <embed> code from youtube pages and paste it right into my article…

I guess not. If it contains the <embed> tag you’ll have to remove it if you want your pages to play on IE.

What’s baffling about this is that it obviously works in IE because it works on YouTube’s pages and they use an embed wrapped in an object. So it must be something on our pages like mootools, slimbox, maybe the position of the object in the document flow? But I haven’t a scooby what it is.

If anyone has any insight into what it may be, please please let me know so I can see if it’s a plugin issue or if it needs to be raised with the appropriate authors of 3rd party libraries.

The good news is, our story so far has at last been documented so next time it happens, post #312 is the place to start!

Last edited by Bloke (2007-11-06 16:22:03)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#324 2007-11-06 19:23:18

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

Re: smd_slimbox

Bloke wrote:

The good news is, our story so far has at last been documented so next time it happens, post #312 is the place to start!

Yeah, I will wait some time before manually editing the code of every video i posted so far… let’s hope someone comes out with a better solution!


Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com

Offline

  1. Index
  2. » Plugin support
  3. » smd_slimbox

Board footer

Powered by FluxBB