Add support for player styles

This currently includes the following styles:

- Invidious, the default
- YouTube, using a centered play button and always visible video control bar

Implements https://github.com/omarroth/invidious/issues/670.
Supersedes https://github.com/omarroth/invidious/pull/661.
This commit is contained in:
Leon Klingele 2019-08-09 02:00:22 +02:00
parent 66b949bed1
commit 46577fb128
No known key found for this signature in database
GPG key ID: 0C8AF48831EEC211
7 changed files with 40 additions and 1 deletions

View file

@ -1478,6 +1478,9 @@ post "/preferences" do |env|
speed = env.params.body["speed"]?.try &.as(String).to_f32?
speed ||= CONFIG.default_user_preferences.speed
player_style = env.params.body["player_style"]?.try &.as(String)
player_style ||= CONFIG.default_user_preferences.player_style
quality = env.params.body["quality"]?.try &.as(String)
quality ||= CONFIG.default_user_preferences.quality
@ -1546,6 +1549,7 @@ post "/preferences" do |env|
locale: locale,
max_results: max_results,
notifications_only: notifications_only,
player_style: player_style,
quality: quality,
redirect_feed: redirect_feed,
related_videos: related_videos,