CoreFiles by mySites.guru
audio.php45 lines, 1,002 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
e3c089c444a52b8a987e99c029a3b2d8
sha1
24961b9ff9841e9192e2bdcac6ad1fa73da16458
sha256
ed63087b846b11234ec84e309033b6c7728ac326fd342bd8191404ae827f1a80
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.Media
 *
 * @copyright   (C) 2026 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Layout\LayoutHelper;

if (empty($field->value) || empty($field->value['file'])) {
    return;
}

$displayData = [
    'src' => $field->value['file'],
];

if ($class = (string) $fieldParams->get('css_class', '')) {
    $displayData['class'] = $class;
}

if ($fieldParams->get('controls', 1) === 1) {
    $displayData['controls'] = 'controls';
}

if ($fieldParams->get('autoplay', 0) === 1) {
    $displayData['autoplay'] = 'autoplay';
}

if ($fieldParams->get('loop', 0) === 1) {
    $displayData['loop'] = 'loop';
}

if ($fieldParams->get('muted', 0) === 1) {
    $displayData['muted'] = 'muted';
}

$displayData['preload'] = $fieldParams->get('preload', 'auto');

echo LayoutHelper::render('joomla.html.audio', $displayData);

The same content is in 28 releases, Joomla 6.1.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.