Update background_video

- Uses type array
- Use the first item in the array
This commit is contained in:
FusionPBX 2024-09-10 04:03:44 -06:00 committed by GitHub
parent 86df5a2e6a
commit e86ec20547
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 6 deletions

View File

@ -56,7 +56,8 @@ class plugin_database {
$theme_login_logo_width = $settings->get('theme', 'login_logo_width', 'auto; max-width: 300px');
$theme_login_logo_height = $settings->get('theme', 'login_logo_height', 'auto; max-height: 300px');
$theme_message_delay = 1000 * (float)$settings->get('theme', 'message_delay', 3000);
$theme_background_video = $settings->get('theme','background_video');
$background_videos = $settings->get('theme', 'background_video', null);
$theme_background_video = (isset($background_videos) && is_array($background_videos)) ? $background_videos[0] : null;
$login_domain_name_visible = $settings->get('login', 'domain_name_visible');
$login_domain_name = $settings->get('login', 'domain_name');
$login_destination = $settings->get('login', 'destination');
@ -329,4 +330,3 @@ class plugin_database {
}
?>

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2022
Portions created by the Initial Developer are Copyright (C) 2008-2024
the Initial Developer. All Rights Reserved.
Contributor(s):
@ -158,6 +158,10 @@
//assign the setings
$view->assign('settings', $settings_array);
}
//background video
if (!empty($_SESSION['theme']['background_video']) && is_array($_SESSION['theme']['background_video'])) {
$view->assign('background_video', $_SESSION['theme']['background_video'][0]);
}
//document title
if (isset($_SESSION['theme']['title']['text']) && $_SESSION['theme']['title']['text'] != '') {
$document_title = $_SESSION['theme']['title']['text'];

View File

@ -1127,9 +1127,9 @@
<body>
{*//video background *}
{if !empty($settings.theme.background_video)}
{if !empty({$background_video})}
<video id="background-video" autoplay muted poster="" disablePictureInPicture="true" onloadstart="this.playbackRate = 1; this.pause();">
<source src="{$settings.theme.background_video}" type="video/mp4">
<source src="{$background_video}" type="video/mp4">
</video>
{/if}