alltube/templates/video.tpl

89 lines
3.6 KiB
Smarty
Raw Normal View History

2015-04-11 22:08:24 +02:00
<div class="wrapper">
<div itemscope itemtype="http://schema.org/VideoObject">
<div class="main">
{include file="logo.tpl"}
2016-06-22 12:32:57 +02:00
<p id="download_intro">You are going to download<i itemprop="name">
2015-04-11 22:08:24 +02:00
<a itemprop="url" id="video_link"
data-ext="{$video->ext}"
data-video="{$video->url|escape}"
href="{$video->webpage_url}">
{$video->title}</a></i>.
2016-06-22 12:32:57 +02:00
</p>
2015-10-31 12:04:13 +01:00
{if isset($video->thumbnail)}
2016-05-01 20:14:58 +02:00
<img itemprop="thumbnailUrl" class="thumb" src="{$video->thumbnail}" alt="" />
{/if}
{if isset($video->description)}
<meta itemprop="description" content="{$video->description|escape}" />
{/if}
{if isset($video->upload_date)}
<meta itemprop="uploadDate" content="{$video->upload_date}" />
2015-10-31 12:04:13 +01:00
{/if}
2015-04-11 22:08:24 +02:00
<br/>
2015-04-12 16:29:05 +02:00
{if isset($video->formats)}
2016-04-10 21:42:38 +02:00
<h3><label for="format">Available formats:</label></h3>
<form action="{path_for name="redirect"}">
<input type="hidden" name="url" value="{$video->webpage_url}" />
2016-05-01 18:58:03 +02:00
<select name="format" id="format" class="formats monospace">
<optgroup label="Generic formats">
<option value="best[protocol^=http]">
{strip}
Best ({$video->ext}
{if isset($video->filesize)}
{$video->filesize}
{/if}
)
{/strip}
</option>
<option value="worst[protocol^=http]">
Worst
</option>
</optgroup>
<optgroup label="Detailed formats" class="monospace">
2016-04-10 21:42:38 +02:00
{foreach $video->formats as $format}
{if $format->protocol|in_array:array('http', 'https')}
{strip}
<option value="{$format->format_id}">
{$format->ext}
{for $foo=1 to (5 - ($format->ext|strlen))}
&nbsp;
{/for}
{if isset($format->width)}
{$format->width}x{$format->height}
{for $foo=1 to (10 - (("{$format->width}x{$format->height}")|strlen))}
&nbsp;
{/for}
{else}
{for $foo=1 to 10}
&nbsp;
{/for}
{/if}
{if isset($format->filesize)}
{($format->filesize/1000000)|round:2} MB
{for $foo=1 to (7 - (($format->filesize/1000000)|round:2|strlen))}
&nbsp;
{/for}
{else}
{for $foo=1 to 10}
&nbsp;
{/for}
{/if}
{if isset($format->format_note)}
{$format->format_note}
{/if}
&nbsp;({$format->format_id})
</option>
{/strip}
{/if}
2016-04-10 21:42:38 +02:00
{/foreach}
</optgroup>
</select><br/><br/>
<input class="downloadBtn" type="submit" value="Download" /><br/>
</form>
2015-04-11 22:08:24 +02:00
{else}
<input type="hidden" name="format" value="best[protocol^=http]" />
2015-04-11 22:08:24 +02:00
<a class="downloadBtn"
href="{$video->url|escape}">Download</a><br/>
{/if}
</div>
</div>