Knowledge Base

Knowledge Base » Scripting / API

Delay when using PHP DomDocument to load vMix API

When using PHP to load the vMix API XML, the native DomDocument.loadXML command will take a long time to connect to the vMix web server:
 
$dom = new DomDocument();
$dom->load("http://127.0.0.1:8088/API/");
 
Instead of loading the web site directly, use CURL first:
 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:8088/api/"); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
$output = curl_exec($ch); 
curl_close($ch);  
 
$dom = new DomDocument();
$dom->loadXML($output);
 

Last Updated: Tuesday, 15 December 2015 10:18:25 AM

Top