diff --git a/classes/local/output_helper.php b/classes/local/output_helper.php index 7f5a063..695ae15 100644 --- a/classes/local/output_helper.php +++ b/classes/local/output_helper.php @@ -138,19 +138,16 @@ public static function output_episode($ocinstanceid, $episodeid, $modinstanceid, return; } - // Find aspect-ratio if there is only one video track. + // Find aspect-ratio of the first video track. + $wrapperattrs = []; if (!empty($data['streams']) && !empty($data['streams'][0]['sources'])) { $sources = $data['streams'][0]['sources']; $res = $sources[array_key_first($sources)][0]['res']; $resolution = $res['w'] . '/' . $res['h']; - echo \html_writer::start_div('player-wrapper', ['style' => '--aspect-ratio:' . $resolution]); - } else { - echo \html_writer::start_div('player-wrapper'); + $wrapperattrs['style'] = '--aspect-ratio:' . $resolution; } - if (empty($data['streams'])) { - \core\notification::error(get_string('erroremptystreamsources', 'mod_opencast')); - } + echo \html_writer::start_div('player-wrapper', $wrapperattrs); echo ''; echo \html_writer::end_div();