diff options
author | Nick Frey <nickfrey123@gmail.com> | 2012-11-28 16:57:07 -0600 |
---|---|---|
committer | Nick Frey <nickfrey123@gmail.com> | 2012-11-28 16:57:07 -0600 |
commit | 207c085b30955761beb0e76837fc1838148a648c (patch) | |
tree | 2bc020e596442a60ed55def4e509292964a57cbe /templates/part.items.php | |
parent | a5fd08475355fce0881b87b29ad0d2577e8cfa6e (diff) |
Play audio podcasts from feeds in the News app
Diffstat (limited to 'templates/part.items.php')
-rw-r--r-- | templates/part.items.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/templates/part.items.php b/templates/part.items.php index efad98830..3d043dfd0 100644 --- a/templates/part.items.php +++ b/templates/part.items.php @@ -50,7 +50,20 @@ foreach($items as $item) { echo '<h2 class="item_author">'. $feedTitle . $author . '</h2>'; } - echo '<div class="body">' . $item->getBody() . '</div>'; + echo '<div class="body">'; + echo $item->getBody(); + + if($item->getEnclosure() !== null) { + $enclosure = $item->getEnclosure(); + $enclosureType = htmlspecialchars($enclosure->getMimeType(), ENT_QUOTES, 'UTF-8'); + $enclosureLink = htmlspecialchars($enclosure->getLink(), ENT_QUOTES, 'UTF-8'); + $enclosureFilename = htmlspecialchars(basename($enclosureLink), ENT_QUOTES, 'UTF-8'); + + echo '<br /><br /><audio controls="controls"><source src="' . $enclosureLink . '" type="' . $enclosureType . '"></source></audio><br />'; + echo '<a href="' . $enclosureLink . '" target="_blank">Original audio source (' . $enclosureFilename . ')</a>'; + } + + echo '</div>'; echo '<div class="bottom_utils">'; echo '<ul class="secondary_item_utils">'; |