feat: allow setting videojs max buffer length via config.yml (#5876)

This commit is contained in:
Fijxu
2026-08-03 15:52:50 -04:00
committed by GitHub
parent b4b6e992fc
commit cb88a805e5
5 changed files with 57 additions and 0 deletions

View File

@@ -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

View File

@@ -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>

View File

@@ -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" %>