]> git.wh0rd.org - tt-rss.git/commitdiff
fix inline flash/html5 audio player
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 15 Jan 2013 07:23:27 +0000 (11:23 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 15 Jan 2013 07:23:27 +0000 (11:23 +0400)
include/functions.php

index 1ae5430c1c654c0858bf3d61d7fd5a9eeb039717..b46e1a28c96e0e4fa8c50c565a71e5166783b784 100644 (file)
 
                                $id = 'AUDIO-' . uniqid();
 
-                               $entry .= "<audio id=\"$id\"\">
-                                       <source src=\"$url\"></source>
+                               $entry .= "<audio id=\"$id\"\" controls>
+                                       <source type=\"$ctype\" src=\"$url\"></source>
                                        </audio>";
 
                                $entry .= "<span onclick=\"player(this)\"
                                                value=\"lib/button/musicplayer.swf?song_url=$url\" />
                                        </object>";
                        }
+
+                       if ($entry) $entry .= "&nbsp;" . basename($url);
+
+                       return $entry;
+
                }
 
-               $filename = substr($url, strrpos($url, "/")+1);
+               return "";
+
+/*             $filename = substr($url, strrpos($url, "/")+1);
 
                $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
-                       $filename . " (" . $ctype . ")" . "</a>";
+                       $filename . " (" . $ctype . ")" . "</a>"; */
 
-               return $entry;
        }
 
        function format_article($link, $id, $mark_as_read = true, $zoom_mode = false, $owner_uid = false) {
 
                        $entries_html = array();
                        $entries = array();
+                       $entries_inline = array();
 
                        foreach ($result as $line) {
 
 
                                $filename = substr($url, strrpos($url, "/")+1);
 
-#                              $player = format_inline_player($link, $url, $ctype);
+                               $player = format_inline_player($link, $url, $ctype);
+
+                               if ($player) array_push($entries_inline, $player);
 
 #                              $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
 #                                      $filename . " (" . $ctype . ")" . "</a>";
                                }
                        }
 
+                       if (count($entries_inline) > 0) {
+                               $rv .= "<hr clear='both'/>";
+                               foreach ($entries_inline as $entry) { $rv .= $entry; };
+                               $rv .= "<hr clear='both'/>";
+                       }
+
                        $rv .= "<br/><div dojoType=\"dijit.form.DropDownButton\">".
                                "<span>" . __('Attachments')."</span>";
                        $rv .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";