From 9e749eda925d6cdd2ca2a40f70049d90ca84817d Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 20 Jun 2019 16:10:18 +0200 Subject: [PATCH] HFP-2766 Allow setting bitrate for video files --- h5p.classes.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 1533a00..d9f1772 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -3899,6 +3899,10 @@ class H5PContentValidator { $file->codecs = htmlspecialchars($file->codecs, ENT_QUOTES, 'UTF-8', FALSE); } + if (isset($file->bitrate)) { + $file->bitrate = intval($file->bitrate); + } + if (isset($file->quality)) { if (!is_object($file->quality) || !isset($file->quality->level) || !isset($file->quality->label)) { unset($file->quality); @@ -3940,7 +3944,7 @@ class H5PContentValidator { */ public function validateVideo(&$video, $semantics) { foreach ($video as &$variant) { - $this->_validateFilelike($variant, $semantics, array('width', 'height', 'codecs', 'quality')); + $this->_validateFilelike($variant, $semantics, array('width', 'height', 'codecs', 'quality', 'bitrate')); } }