You are here

function jw_player_update_8003 in JW Player 8

Initialize autostart presets setting.

File

./jw_player.install, line 87
Install, update and uninstall functions for the JW Player module.

Code

function jw_player_update_8003() {
  $presets = Jw_player::loadMultiple();
  foreach ($presets as $preset) {
    $settings = $preset
      ->getSettings();
    if (isset($settings['autoplay'])) {
      $preset->settings['autostart'] = $settings['autoplay'];
      unset($preset->settings['autoplay']);
      $preset
        ->save();
    }
  }
}