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

View file

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