From 8057987d739bbbc6a3c0333c03015ffc592f9a8a Mon Sep 17 00:00:00 2001 From: Natkeeran Date: Fri, 1 Nov 2019 14:49:53 -0400 Subject: [PATCH] videojs --- .../islandora_videojs.info.yml | 7 +++ .../islandora_videojs.module | 56 +++++++++++++++++++ .../templates/videojs.html.twig | 23 ++++++++ 3 files changed, 86 insertions(+) create mode 100644 modules/islandora_videojs/islandora_videojs.info.yml create mode 100644 modules/islandora_videojs/islandora_videojs.module create mode 100644 modules/islandora_videojs/templates/videojs.html.twig diff --git a/modules/islandora_videojs/islandora_videojs.info.yml b/modules/islandora_videojs/islandora_videojs.info.yml new file mode 100644 index 00000000..f5f41547 --- /dev/null +++ b/modules/islandora_videojs/islandora_videojs.info.yml @@ -0,0 +1,7 @@ +name: 'Islandora Videojs' +description: 'Islandora Videojs overrides' +type: module +package: Islandora +core: 8.x +dependencies: + - islandora diff --git a/modules/islandora_videojs/islandora_videojs.module b/modules/islandora_videojs/islandora_videojs.module new file mode 100644 index 00000000..6e6a40d7 --- /dev/null +++ b/modules/islandora_videojs/islandora_videojs.module @@ -0,0 +1,56 @@ +' . t('About') . ''; + $output .= '

' . t('Islandora Videojs overrides.') . '

'; + $output .= '

' . t('Customizes videojs.') . '

'; + return $output; + + default: + } +} + + +function islandora_videojs_theme_registry_alter(&$theme_registry) { + $module_path = drupal_get_path('module', 'islandora_videojs'); + + // Use the templates in my module's template folder. + $theme_registry['videojs'] = $theme_registry['videojs']; + $theme_registry['videojs']['path'] = $module_path . '/templates'; + $theme_registry['videojs']['template'] = 'videojs'; +} + + +function islandora_videojs_theme($existing, $type, $theme, $path) { + return array( + 'videojs' => array( + 'variables' => array('items' => NULL, 'player_attributes' => NULL, 'testvar' => 'testvalue'), + 'base hook' => 'videojs' + ), + ); +} + + + + diff --git a/modules/islandora_videojs/templates/videojs.html.twig b/modules/islandora_videojs/templates/videojs.html.twig new file mode 100644 index 00000000..0c9b0375 --- /dev/null +++ b/modules/islandora_videojs/templates/videojs.html.twig @@ -0,0 +1,23 @@ +{# +/** + * @file + * Default theme implementation to display a formatted video field. + * + * Available variables: + * - items: A collection of videos. + * - player_attributes: Player options including the following: + * - width: The width of the video (if known). + * - height: The height of the video (if known). + * - autoplay: Autoplay on or off + * + * @ingroup themeable + */ +#} +

Videojs Test {{ testvar }}

+