Skip to content

Instantly share code, notes, and snippets.

@Renrhaf
Created December 31, 2015 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Renrhaf/58d3ae718daf81626793 to your computer and use it in GitHub Desktop.
Save Renrhaf/58d3ae718daf81626793 to your computer and use it in GitHub Desktop.
INFO_882_custom_apios_player.patch
diff --git a/modules/custom/arte_apios_player/arte_apios_player.module b/modules/custom/arte_apios_player/arte_apios_player.module
index ecbe3e6..d4e790a 100755
--- a/modules/custom/arte_apios_player/arte_apios_player.module
+++ b/modules/custom/arte_apios_player/arte_apios_player.module
@@ -52,6 +52,9 @@ function arte_apios_player_theme() {
'autostart' => 0,
'thumbnail' => NULL,
'atom' => NULL,
+ 'image' => NULL,
+ 'context' => NULL,
+ 'legend' => NULL,
),
'template' => 'arte-apios-player',
),
@@ -199,6 +202,8 @@ function arte_apios_player_scald_prerender($atom, $context, $options, $mode) {
// Video thumbnail
$thumbnail = _arte_apios_player_get_video_thumbnail($atom);
+ $image = _arte_apios_player_get_video_thumbnail_path($atom);
+ $legend = _arte_apios_player_get_video_legend($atom);
// Render the player
$atom->rendered->player = theme('arte_apios_player', array(
@@ -211,6 +216,10 @@ function arte_apios_player_scald_prerender($atom, $context, $options, $mode) {
'autostart' => ($autostart ? 1 : 0),
'thumbnail' => $thumbnail,
'atom' => $atom,
+ 'image' => $image,
+ 'context' => $context,
+ 'legend' => $legend,
+ 'options' => $options,
));
}
@@ -486,6 +495,26 @@ function arte_apios_player_get_config($atom, $context = ARTE_APIOS_PLAYER_CONTEX
}
/**
+ * Gets the legend of the given video.
+ *
+ * @param object $atom
+ * The video atom object.
+ * @return string
+ * The video legend
+ *
+ * @return string
+ * The legend of the video.
+ */
+function _arte_apios_player_get_video_legend($atom) {
+ global $language;
+ $legend = '';
+ if (!empty($atom->data['texts'][$language->language][0]['teaser'])) {
+ $legend = $atom->data['texts'][$language->language][0]['teaser'];
+ }
+ return $legend;
+}
+
+/**
* Generates the video thumbnail HTML.
*
* @param object $atom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment