Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2018-08-06 01:25:21

BryanA.
Member
From: Maryland, USA
Registered: 2007-08-12
Posts: 101

Re: [Solved] html and audio

You can say that again! “Presentation › Forms › Article” Because you know what? Even after 107 tries, it doesn’t work in Presentation > Pages > Default At all. Anywhere.

So, that’s awkward. Onward, no styling, no clean up yet and not much except bare bones: snakebite.cafe is the thing. Half hour episodes BUT is it too much to ask for persistence in the player? Listen, not finish, walk away, come back and pick up where you left off OR jump through the episode?

I’ll be prefixing SOLVED – anything else is just cake. Thanks all!


Voice Actor – starting up a site for that good book stuff.

Offline

#14 2018-08-06 08:52:23

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,599
Website

Re: [Solved] html and audio

Glad you got it working in principle.

I think the lack of full controls might be because your code is embedding the download link, e.g. http://www.domain.com/file_download/10/filename.mp3 and therefore the browser interprets that as an internet stream.

Try putting one of the following into your custom field instead of the ID#.

  • just the filename, e.g. filename.mp3
  • the path as /files/filename.mp3
  • or the URL as http://www.domain.com/files/filename.mp3.

and see if you get better results.

If not, look at the source code and if you’re still getting a src with /file_download/ in the link. If you’re still getting that go back to using the ID# in your custom field and try the following change to your code:

<txp:variable name="podcast_filename"><txp:file_download_list id='<txp:custom_field name="custom_1" />'><txp:site_url />files/<txp:file_download_name /></txp:file_download_list></txp:variable>
<txp:oui_audio controls="1" play='<txp:variable name="podcast_filename" />' />

That’s untested but I hope it works. The idea is that your source code will show src="http://www.domain.com/files/filename.mp3" and the browser recognises that as hosted file and constructs the player with the progress bar. You could also try omitting <txp:site_url /> in the example above and replace it with a / so that you get src="/files/filename.mp3"


TXP Builders – finely-crafted code, design and txp

Offline

#15 2018-08-06 09:10:53

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,599
Website

Re: [Solved] html and audio

BryanA. wrote #313267:

You can say that again! “Presentation › Forms › Article” Because you know what? Even after 107 tries, it doesn’t work in Presentation > Pages > Default At all. Anywhere.

I guess the reason there is that the plugin looks at the value in your article’s custom_field and on a page template it won’t know that. The “Default” form (or whatever you decide to use) in “Presentation › Forms › Article” will always be within an article context. The page template, on the other hand, only knows the ‘context’ (= if this is a section start page, a list page, an individual article) when you explicitly tell it what to do in different contexts: e.g. place your code within an “if_individual_article” container.

In the page template that comes with the standard theme, it calls txp:article. The txp:article tag is clever in that it is context-sensitive and automatically uses the “default” article form for individual articles and the “article_listing” article form for article lists. That’s why those are the forms to edit. You can override that by specifying your own form names using the form and listform attributes and creating your own article forms.


TXP Builders – finely-crafted code, design and txp

Offline

#16 2018-08-12 22:21:01

BryanA.
Member
From: Maryland, USA
Registered: 2007-08-12
Posts: 101

Re: [Solved] html and audio

“Try putting one of the following into your custom field instead of the ID#.

  • just the filename, e.g. filename.mp3
  • the path as /files/filename.mp3
  • or the URL as http://www.domain.com/files/filename.mp3.

and see if you get better results.”

Following up! Finally had the chance to test the small stuff – my oui_audio installation prefers a FULL explicit URL at snakebite.cafe otherwise it’s lost or trying for download-file instructions.

I’ll give the other rewrites a test this week or next weekend so I don’t have to re-type strange file names as they come along! I appreciate it greatly. It’s been a blast so far and this makes it easier for the curious to listen where they want! :)


Voice Actor – starting up a site for that good book stuff.

Offline

#17 2018-08-25 17:46:38

gilibaus
Member
From: Italy
Registered: 2013-08-14
Posts: 91
Website

Re: [Solved] html and audio

I have been running a (not just) podcasting website since 2017 using Txp 4.5.7. The player I use is plyr.io, an awesome (and free) piece of software. If you want, take a look: https://www.mindfulnessbergamo.net/podcast/. And if you have any questions, just ask! Happy podcasting :)

Offline

Board footer

Powered by FluxBB