JplayerPlayer.php in jPlayer 8.2
File
src/Plugin/Field/FieldFormatter/JplayerPlayer.php
View source
<?php
namespace Drupal\jplayer\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Annotation;
use Drupal\Core\Annotation\Translation;
class JplayerPlayer extends FileFormatterBase implements ContainerFactoryPluginInterface {
public function settingsForm(array $form, FormStateInterface $form_state) {
$elements = parent::settingsForm($form, $form_state);
$elements['audio_player'] = array(
'#type' => 'radios',
'#title' => $this
->t('Select Player'),
'#default_value' => $this
->getSetting('audio_player'),
'#options' => $plugins,
);
return $elements;
}
public function viewElements(FieldItemListInterface $items) {
}
}
Classes
Name |
Description |
JplayerPlayer |
Plugin annotation
@FieldFormatter(
id = "jplayer_player",
label = @Translation("jPlayer - Player"),
description = @Translation("Display file fields as an HTML5-compatible with Flash-fallback media player."),
field_types = {
"file",
"text",
… |