You are here

public function JPlayerAudioPlayer::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/JPlayerAudioPlayer.php, line 176

Class

JPlayerAudioPlayer
Implements the jPlayer 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'];
}