Direct link to videos

This commit is contained in:
Pierre Rudloff 2014-05-23 19:11:03 +02:00
parent 29fb037706
commit 8a9298fb1b
2 changed files with 11 additions and 9 deletions

16
api.php
View File

@ -48,20 +48,18 @@ if (isset($_GET["url"])) {
<?php <?php
if (isset($video->formats)) { if (isset($video->formats)) {
?> ?>
<legend for="format">Select format</legend> <h3>Available formats:</h3>
<select id="format" name="format"> <p>(You might have to do a <i>Right click > Save as</i>)</p>
<ul id="format" class="format">
<?php <?php
foreach ($video->formats as $format) { foreach ($video->formats as $format) {
echo '<option value="', $format->format_id, '"'; echo '<li>';
if ($format->format_id == $video->format_id) { echo '<a href="', $format->url ,'">';
echo ' selected ';
}
echo '>';
echo $format->format, ' (', $format->ext, ')'; echo $format->format, ' (', $format->ext, ')';
echo '</option>'; echo '</a></li>';
} }
?> ?>
</select><br/><br/> </ul><br/><br/>
<?php <?php
} else { } else {
?> ?>

View File

@ -538,6 +538,10 @@ h1 {
vertical-align:middle; vertical-align:middle;
} }
.format {
text-align:left;
}
@media (max-width: 640px) { @media (max-width: 640px) {
.thumb { .thumb {
width:90%; width:90%;