You are here

function mediaelement_parse_config in MediaElement 8

Converts module into JS config.

Parameters

array $confg: An array of config items.

1 call to mediaelement_parse_config()
mediaelement_preprocess_html in ./mediaelement.module
Implements hook_preprocess_html().

File

./mediaelement.module, line 113
Primary module file.

Code

function mediaelement_parse_config($config) {
  $settings = [];
  $config = mediaelement_flatten_config($config);

  // Prepare config for Javascript.
  foreach ($config as $setting => $value) {

    // Camel case the setting name.
    $settingCamel = str_replace('_', '', lcfirst(ucwords($setting, '_')));
    $settings[$settingCamel] = $value;
  }
  return $settings;
}