You are here

public function SoundManagerAudioPlayer::getPluginLibraryVersion in AudioField 8

Parses library to get version number of installed library.

Return value

string The version number of the currently installed library.

Overrides AudioFieldPluginBase::getPluginLibraryVersion

File

src/Plugin/AudioPlayer/SoundManagerAudioPlayer.php, line 77

Class

SoundManagerAudioPlayer
Implements the SoundManager Audio Player plugin.

Namespace

Drupal\audiofield\Plugin\AudioPlayer

Code

public function getPluginLibraryVersion() {

  // Parse the JSON file for version info.
  $library_path = $this->fileSystem
    ->realpath(DRUPAL_ROOT . $this
    ->getPluginLibraryPath() . '/package.json');
  $library_data = Json::decode(file_get_contents($library_path));
  return $library_data['version'];
}