public function WavesurferAudioPlayer::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/ WavesurferAudioPlayer.php, line 191
Class
- WavesurferAudioPlayer
- Implements the Wavesurfer Audio Player plugin.
Namespace
Drupal\audiofield\Plugin\AudioPlayerCode
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'];
}