[Luis] fix a bug in demo code, improve a bit the code
[Luis] fix a bug in demo code, improve a bit the code

mjamrozek/VPAIDHTML5Client,MailOnline/VPAIDHTML5Client,MailOnline/VPAIDHTML5Client,jdreetz/VPAIDHTML5Client,jdreetz/VPAIDHTML5Client,AltitudeDigital/VPAIDHTML5Client,AltitudeDigital/VPAIDHTML5Client