From 29c3b0bc265211a2d0e103ce4df3c1a401c75c7f Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 2 Jan 2014 12:55:49 +0000 Subject: [PATCH] --- inc/ws/Util/html5/class.ws.html5.links.php | 37 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index b367dca78..ab78307c1 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -546,12 +546,30 @@ class htmlMultimediaLink extends wsHTML5Link { $w = $this->width * $this->getCssScale(); $h = $this->height * $this->getCssScale(); - $this->_url = $d['fdir'] . '/' . $this->_config['html']; + if ($this->_config['html']) { + $this->_url = $d['fdir'] . '/' . $this->_config['html']; - $iw = $this->_config['width']; - $ih = $this->_config['height']; + $iw = $this->_config['width']; + $ih = $this->_config['height']; + + $res = ''; + } else { + $res = ''; + } + + foreach ($this->_config['inject'] as $i) { + $i = str_replace('$id', '"#' . $this->id . '"', $i); + $this->compiler->htmlmultimedia[] = $i; + } + + foreach ($this->_config['injectcss'] as $i) { + + } + + foreach ($this->_config['injectjs'] as $i) { + + } - $res = ''; $this->copyExternalDir($d['dir']); $this->_content = $res; } @@ -592,7 +610,14 @@ class htmlMultimediaLink extends wsHTML5Link { } public function getConfigZIP($d) { - return array('html' => 'index.html', 'width' => $this->video_width, 'height' => $this->video_height); + + $res = array('width' => $this->video_width, 'height' => $this->video_height); + if (file_exists($d . '/index.html')) { + $r = array('html' => 'index.html', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array()); + } else { + $r = array('html' => false, 'inject' => file_get_contents($d . '/init.js'), 'injectcss' => 'multimedia.css', 'injectjs' => 'multimedia.js'); + } + return array_merge($res, $r); } public function getConfigOAM($d) { @@ -605,7 +630,7 @@ class htmlMultimediaLink extends wsHTML5Link { $props = array('default-width' => 'width', 'default-height' => 'height', 'html-page' => 'html'); - $res = array('content' => trim($c->content), 'name' => $c->_name, 'assets' => array()); + $res = array('inject' => array(), 'injectcss' => array(), 'injectjs' => array(), 'content' => trim($c->content), 'name' => $c->_name, 'assets' => array()); foreach ($c->properties->property as $p) { if (isset($props[$p->_name])) { $res[$props[$p->_name]] = $p->_defaultValue; -- 2.39.5