mirror of
https://github.com/iv-org/invidious.git
synced 2026-08-05 06:41:48 +00:00
feat: allow setting videojs max buffer length via config.yml (#5876)
This commit is contained in:
@@ -186,6 +186,19 @@ class Config
|
||||
# Disable easy to abuse API endpoints
|
||||
property disable_abusable_api : Bool = false
|
||||
|
||||
property videojs : VideoJSConfig = VideoJSConfig.from_yaml("")
|
||||
|
||||
struct VideoJSConfig
|
||||
include YAML::Serializable
|
||||
include JSON::Serializable
|
||||
|
||||
# This are the default values that VideoJS uses.
|
||||
# See `assets/videojs/video.js/video.js` file
|
||||
# and search for `GOAL_BUFFER_LENGTH` and `MAX_GOAL_BUFFER_LENGTH`
|
||||
property goal_buffer_length : Int32? = 30
|
||||
property max_goal_buffer_length : Int32? = 60
|
||||
end
|
||||
|
||||
def disabled?(option)
|
||||
case disabled = CONFIG.disable_proxy
|
||||
when Bool
|
||||
|
||||
@@ -30,6 +30,13 @@
|
||||
}.to_pretty_json
|
||||
%>
|
||||
</script>
|
||||
<script id="config" type="application/json">
|
||||
<%=
|
||||
{
|
||||
"videojs" => CONFIG.videojs,
|
||||
}.to_pretty_json
|
||||
%>
|
||||
</script>
|
||||
|
||||
<%= rendered "components/player" %>
|
||||
<script src="/js/embed.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
|
||||
@@ -79,6 +79,13 @@ we're going to need to do it here in order to allow for translations.
|
||||
}.to_pretty_json
|
||||
%>
|
||||
</script>
|
||||
<script id="config" type="application/json">
|
||||
<%=
|
||||
{
|
||||
"videojs" => CONFIG.videojs,
|
||||
}.to_pretty_json
|
||||
%>
|
||||
</script>
|
||||
|
||||
<div id="player-container" class="h-box">
|
||||
<%= rendered "components/player" %>
|
||||
|
||||
Reference in New Issue
Block a user