Layout: Theater layout: Expand video width across page only as necessary based on length of video
This commit is contained in:
parent
cb5f36581d
commit
3d911e4987
@ -17,9 +17,12 @@
|
|||||||
{% if theater_mode %}
|
{% if theater_mode %}
|
||||||
video{
|
video{
|
||||||
grid-column: 1 / span 5;
|
grid-column: 1 / span 5;
|
||||||
width: 100%;
|
justify-self: center;
|
||||||
|
max-width: 100%;
|
||||||
|
width: {{ theater_video_target_width }}px;
|
||||||
max-height: {{ video_height }}px;
|
max-height: {{ video_height }}px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
background-color: #bcbcbc;
|
||||||
}
|
}
|
||||||
.related-videos-outer{
|
.related-videos-outer{
|
||||||
grid-row: 2 /span 3;
|
grid-row: 2 /span 3;
|
||||||
|
@ -57,6 +57,7 @@ def get_video_sources(info):
|
|||||||
'src': format['url'],
|
'src': format['url'],
|
||||||
'type': 'video/' + format['ext'],
|
'type': 'video/' + format['ext'],
|
||||||
'height': format['height'],
|
'height': format['height'],
|
||||||
|
'width': format['width'],
|
||||||
})
|
})
|
||||||
|
|
||||||
#### order the videos sources so the preferred resolution is first ###
|
#### order the videos sources so the preferred resolution is first ###
|
||||||
@ -199,6 +200,8 @@ def get_watch_page():
|
|||||||
video_sources = get_video_sources(info)
|
video_sources = get_video_sources(info)
|
||||||
video_height = video_sources[0]['height']
|
video_height = video_sources[0]['height']
|
||||||
|
|
||||||
|
# 1 second per pixel, or the actual video width
|
||||||
|
theater_video_target_width = max(640, info['duration'], video_sources[0]['width'])
|
||||||
|
|
||||||
return flask.render_template('watch.html',
|
return flask.render_template('watch.html',
|
||||||
header_playlist_names = local_playlist.get_playlist_names(),
|
header_playlist_names = local_playlist.get_playlist_names(),
|
||||||
@ -221,6 +224,7 @@ def get_watch_page():
|
|||||||
comments_mode = settings.comments_mode,
|
comments_mode = settings.comments_mode,
|
||||||
|
|
||||||
video_height = video_height,
|
video_height = video_height,
|
||||||
|
theater_video_target_width = theater_video_target_width,
|
||||||
|
|
||||||
title = info['title'],
|
title = info['title'],
|
||||||
uploader = info['uploader'],
|
uploader = info['uploader'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user