]> _ Git - cubeextranet.git/commitdiff
done #1058 @2
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 3 Jan 2017 15:13:27 +0000 (15:13 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 3 Jan 2017 15:13:27 +0000 (15:13 +0000)
inc/ws/Util/html5/class.ws.html5.links.php

index 95c2a04b50e430c4413c44a085340ba097290fbd..a83f26234cc0ff231b4ab88ab2d8d1bc3fc8f2e2 100644 (file)
@@ -805,6 +805,16 @@ class htmlMultimediaLink extends wsHTML5Link {
        public function getConfigZIP($d) {
                $res = array('width' => $this->video_width, 'height' => $this->video_height);
                if (file_exists($d . '/index.html')) {
+                       $doc = new DOMDocument();
+                       $doc->loadHTMLFile($d . '/index.html');
+                       $xpath = new DOMXPath($doc);
+                       $c = $xpath->query("//canvas");
+                       foreach ($c as $canvas) {
+                               /* @var $canvas DOMElement */
+                               $res['width'] = intval((string)$canvas->getAttribute('width'));
+                               $res['height'] = intval((string)$canvas->getAttribute('height'));
+                       }
+
                        $r = array('html' => 'index.html', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
                } else {
                        $r = array('html' => false, 'inject' => array(file_get_contents($d . '/init.js')), 'injectcss' => array('multimedia.css'), 'injectjs' => array('multimedia.js'));