$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 = '<iframe width="' . $iw . '" height="' . $ih . '" src="' . $this->_url . '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>';
+ } 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 = '<iframe width="' . $iw . '" height="' . $ih . '" src="' . $this->_url . '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>';
$this->copyExternalDir($d['dir']);
$this->_content = $res;
}
}
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) {
$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;