diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-08-24 17:55:14 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-08-24 17:55:14 -0700 |
commit | 3d911e4987ef9768702729e60d51cb872700a716 (patch) | |
tree | a952b86463b7717de7d4b36b2991e3068ad8df49 /youtube/watch.py | |
parent | cb5f36581d74c22b6a0705dedf6acf40b6e052db (diff) | |
download | yt-local-3d911e4987ef9768702729e60d51cb872700a716.tar.lz yt-local-3d911e4987ef9768702729e60d51cb872700a716.tar.xz yt-local-3d911e4987ef9768702729e60d51cb872700a716.zip |
Layout: Theater layout: Expand video width across page only as necessary based on length of video
Diffstat (limited to 'youtube/watch.py')
-rw-r--r-- | youtube/watch.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube/watch.py b/youtube/watch.py index 0515dea..8f83e48 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -57,6 +57,7 @@ def get_video_sources(info): 'src': format['url'], 'type': 'video/' + format['ext'], 'height': format['height'], + 'width': format['width'], }) #### 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_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', header_playlist_names = local_playlist.get_playlist_names(), @@ -221,6 +224,7 @@ def get_watch_page(): comments_mode = settings.comments_mode, video_height = video_height, + theater_video_target_width = theater_video_target_width, title = info['title'], uploader = info['uploader'], |