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();
Instead of loading the web site directly, use CURL first:
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, ""); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
$output = curl_exec($ch); 
$dom = new DomDocument();

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