Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: using txp tags in article body
Ah, when I said “it works” I mean “it renders” without error, not “it plays video” or “it shows the poster”!
I remember when I was trying this technique (multiple source elements inside a single video tag) I had no end of troubles: one would work on FF, not Chrome. Then if I jiggled stuff about a bit, FF would not show the input controls, but Safari and Chrome would work, while Opera would hang up, or one of them would refuse to show the poster, etc.
In the end the only thing that worked across browser was a single video tag with a src attribute. Even then I never got the poster working so I took it out *shrug*
Anyway, one thing at a time: let’s get the output actually rendering error-free tags (as viewed in the source) and then worry about actually getting the videos to play and the controls/poster to render.
Last edited by Bloke (2012-02-06 15:07:06)
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
#14 2012-02-06 15:12:55
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: using txp tags in article body
Ah sorry my misunderstanding. Well this is the code that’s rendered:
<video poster="<img src="http://example.com/images/31.jpg" alt="" width="358" height="269" />" width="358" height="269" controls="" preload="">
<source src="http://example.com/files/video.mp4">
<source src="http://example.com/files/video.ogv">
</video>
—Edit—
Actually that seems to be how Google copies the code to the clipboard. The actual code is displayed as:
<video poster="<img src="http://tonto/example.com/images/31.jpg" alt="" width="358" height="269" />" width=358" height="269" controls preload>
<source src="http://example.com/files/video.mp4">
<source src="http://example.com/files/video.ogv">
</video>
Last edited by Algaris (2013-07-10 22:56:07)
Offline
Re: using txp tags in article body
Right so the <txp:image>
tag has returned double quotes which are then inside double quotes in the poster
attribute. In theory (with Textile shut off), using single quotes for the poster
attribute will fix it.
If not, then maybe something else is getting in the way, as you suggested. If it’s not the server, maybe some plugin (long shot!)
EDIT: oh, and you have a missing double-quote from the start of your width
attribute in the ‘video’ tag. Although HTML is pretty forgiving, any mis-quoting might be screwing things up in this case.
Last edited by Bloke (2012-02-06 15:29:01)
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
#16 2012-02-06 15:47:09
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: using txp tags in article body
I double checked my code in the txp article and the poster
attribute is surrounded with single quotes although it keeps getting rendered with double quotes.
The missing double quote typo was from retyping the code in the browser source to post here as Google wouldn’t let me copy and paste it.
I’ve disabled all the running plugins and refreshed the page and it still renders the code the same way.
Offline
Re: using txp tags in article body
What happens if you do this:
==<txp:output_form form="video_stuff" />==
and farm it out to a Form? Past that I’m stumped. Anyone else?
Last edited by Bloke (2012-02-06 16:07:23)
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
Re: using txp tags in article body
or better still if you want it to be flexible, to an smd_macro … ?
TXP Builders – finely-crafted code, design and txp
Offline
#19 2012-02-06 16:25:42
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: using txp tags in article body
Thank you so much for your time Steff.
In the end I used the following code and everything now works perfectly:
==<video poster="<txp:site_url />images/31.jpg" width="358" height="269" controls preload>
<source src="<txp:site_url />files/video.mp4"></source>
<source src="<txp:site_url />files/video.ogv"></source>
</video>==
I still have no idea why using <txp:image id="31" />
would force double quotes in the rendered code though.
—Edit—
jakob: oooo, intereasting.
Last edited by Algaris (2012-02-06 16:26:32)
Offline