Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio directly in newslist and newsreader ? #1

Open
JLBA opened this issue Jul 27, 2024 · 2 comments
Open

Audio directly in newslist and newsreader ? #1

JLBA opened this issue Jul 27, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request low prio

Comments

@JLBA
Copy link

JLBA commented Jul 27, 2024

Hello,
I'm testing contao-podcast-fedd-bundle. I understand it is aimed to add podcast files to rss or atom feed.

But is it possible to modify news_list and/or news_reader models to add directly the audi file (using contao audio/video function) ?

Thanks

@JLBA JLBA added the enhancement New feature or request label Jul 27, 2024
@lukasbableck
Copy link
Owner

lukasbableck commented Jul 29, 2024

I think this should be changed in the news_*.html5 template if needed and not be a default behavior of this bundle. We would have to provide 4 additional modified templates (news_*.html5) which could potentially change in contao/news-bundle and affect compatibility.

You can easily output an audio element with the podcast file like this in one of the news_*.html5 templates:

<?php
if ($this->podcastFile){
	$file = Contao\FilesModel::findByUuid(Contao\StringUtil::binToUuid($this->podcastFile));
	?>
	<audio controls>
		<?php $this->addCspSource('media-src', $file->path); ?>
		<source src="<?= $file->path ?>" type="<?= $file->mime ?>">
	</audio>
	<?php
}
?>

I'll keep it in mind though, maybe I will add something like that in the future. But currently you will have to edit the template yourself.

@lukasbableck lukasbableck self-assigned this Jul 29, 2024
@JLBA
Copy link
Author

JLBA commented Jul 29, 2024

Works fine. Thanks for your answer.
And waiting for the update with specific models... ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low prio
Projects
None yet
Development

No branches or pull requests

2 participants