aboutsummaryrefslogtreecommitdiff
path: root/start.php
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2012-04-10 12:04:42 -0400
committerSteve Clay <steve@mrclay.org>2012-04-10 12:04:42 -0400
commit4af120de2bd0fe2046795346a40102f00fbe5479 (patch)
tree5022ba0160427bec07cf9fdf337ef8161e4071b9 /start.php
parent4a447a9cfe118373f3b5e7ec35382239455d1541 (diff)
downloadelgg-4af120de2bd0fe2046795346a40102f00fbe5479.tar.gz
elgg-4af120de2bd0fe2046795346a40102f00fbe5479.tar.bz2
Allow plugins to alter video dimensions.
Diffstat (limited to 'start.php')
-rw-r--r--start.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/start.php b/start.php
index 2791b1185..77bf0a7bc 100644
--- a/start.php
+++ b/start.php
@@ -289,6 +289,34 @@ function videolist_icon_url_override($hook, $type, $returnvalue, $params) {
}
/**
+ * @param ElggObject $videolist_item
+ * @return array
+ */
+function videolist_get_video_dimensions(ElggObject $videolist_item) {
+ $dimensions = array(
+ 'width' => 600,
+ 'height' => 400,
+ );
+ $params['entity'] = $videolist_item;
+ $params['videotype'] = $videolist_item->videotype;
+ $dimensions = elgg_trigger_plugin_hook(
+ 'videolist:setdimensions',
+ $params['videotype'],
+ $params,
+ $dimensions);
+ if (! is_array($dimensions)) {
+ $dimensions = array();
+ }
+ if (empty($dimensions['width']) || ! is_numeric($dimensions['width'])) {
+ $dimensions['width'] = 600;
+ }
+ if (empty($dimensions['height']) || ! is_numeric($dimensions['height'])) {
+ $dimensions['height'] = 400;
+ }
+ return $dimensions;
+}
+
+/**
* Prepend HTTP scheme if missing
* @param string $hook
* @param string $type