Commit 73e49b42 authored by Steffen Schlaer's avatar Steffen Schlaer
Browse files

Issue #3261320 by IT-Cru: Adapt field formatter settings from video_embed_field_plyr module

parent 5ac59c28
Loading
Loading
Loading
Loading

js/plyr-remote-video.js

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
const players = Plyr.setup('.plyr-player');
+0 −6
Original line number Diff line number Diff line
@@ -6,12 +6,6 @@ plyr:
  js:
    https://cdn.plyr.io/3.6.12/plyr.js: { type: external, minified: true }

plyr-remote-video:
  js:
    js/plyr-remote-video.js: {}
  dependencies:
    - plyr/plyr

plyr-player:
  js:
    js/plyr-player.js: {}
+6 −2
Original line number Diff line number Diff line
@@ -12,18 +12,22 @@ function plyr_theme() {
  return [
    'plyr_file_audio' => [
      'variables' => [
        'files' => [],
        'attributes' => NULL,
        'files' => [],
        'plyr_settings' => [],
      ],
    ],
    'plyr_file_video' => [
      'variables' => [
        'files' => [],
        'attributes' => NULL,
        'files' => [],
        'plyr_settings' => [],
      ],
    ],
    'plyr_remote_video' => [
      'variables' => [
        'attributes' => NULL,
        'plyr_settings' => [],
        'video_provider' => NULL,
        'video_embed_id' => NULL,
      ],
+0 −13
Original line number Diff line number Diff line
@@ -24,17 +24,4 @@ class PlyrFileAudioFormatter extends PlyrFormatterBase {
    return 'audio';
  }

  /**
   * {@inheritdoc}
   */
  public function viewElements(FieldItemListInterface $items, $langcode) {
    $elements = parent::viewElements($items, $langcode);

    if (!empty($elements)) {
      $elements['#attached']['library'][] = 'plyr/plyr-player';
    }

    return $elements;
  }

}
+0 −13
Original line number Diff line number Diff line
@@ -24,17 +24,4 @@ class PlyrFileVideoFormatter extends PlyrFormatterBase {
    return 'video';
  }

  /**
   * {@inheritdoc}
   */
  public function viewElements(FieldItemListInterface $items, $langcode) {
    $elements = parent::viewElements($items, $langcode);

    if (!empty($elements)) {
      $elements['#attached']['library'][] = 'plyr/plyr-player';
    }

    return $elements;
  }

}
Loading