lukasbableck / contao-podcast-feed-bundle

Adds podcast data to the XML feed generated by Contao.
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Audio directly in newslist and newsreader ? #1

Open JLBA opened 3 months ago

JLBA commented 3 months ago

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

lukasbableck commented 3 months ago

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.

JLBA commented 3 months ago

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