You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionsuccessCallback(services){// Listen for service push messagesservices[0].addEventListener('message',function(msg){debug.innerHTML+="<br>"+services[0].name+" event received: ";debug.textContent+=msg.data;},false);// Send a control signal to mute the service audiovarsvcXhr=newXMLHttpRequest();svcXhr.open("POST",services[0].url);// services[0].url and its// subresources have been whitelisted for// cross-site XHR use in this current// browsing context.svcXhr.setRequestHeader('SOAPAction','urn:schemas-upnp-org:service:RenderingControl:1#SetMute');svcXhr.setRequestHeader('Content-Type','text/xml; charset="utf-8";');svcXhr.onreadystatechange=function(response){if(response.readyState!=4||response.status!=200)return;debug.innerHTML+="<br>"+services[0].name+" response received: ";debug.textContent+=response.responseXML;}// Service messaging to mute the provided servicevarsvcMsg='<?xml version="1.0" encoding="utf-8"?>'+'<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" '+'xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">'+'<s:Body>'+'<u:SetMute xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">'+'<InstanceID>0</InstanceID>'+'<Channel>Master</Channel>'+'<DesiredMute>true</DesiredMute>'+'</u:SetMute>'+'</s:Body>'+'</s:Envelope>';svcXhr.send(svcMsg);debug.innerHTML+="<br>"+services[0].name+" request sent: ";debug.textContent+=svcMsg;}functionerrorCallback(error){debug.innerHTML+="<br>An error occurred: "+error.code;}
The text was updated successfully, but these errors were encountered:
after implementing whitelist-xhr, trying to control over SOAP will be necessary.
Opera's sample code is helpful.
http://people.opera.com/richt/release/specs/discovery/Overview.html
The text was updated successfully, but these errors were encountered: