Javascript 使用jquery和Kurento更改图像源
我使用Kurento magic mirror,每次我更改图像时,我都被迫更改图片的名称mario-Wings.png 下面是显示的代码 函数getopts(args,opts) { var result=opts.default | |{}; args.replace( 新的RegExp(“([^?=&]+)(=([^&]*))?”,“g”), 函数($0,$1,$2,$3){result[$1]=decodeURI($3);}); 返回结果; }; var args=getopts(location.search, { 违约: { ws_uri:'ws://'+location.hostname+':8888/kurento', hat_uri:'http://'+location.host+'/img/mario wings.png', ice_服务器:未定义 }Javascript 使用jquery和Kurento更改图像源,javascript,jquery,kurento,Javascript,Jquery,Kurento,我使用Kurento magic mirror,每次我更改图像时,我都被迫更改图片的名称mario-Wings.png 下面是显示的代码 函数getopts(args,opts) { var result=opts.default | |{}; args.replace( 新的RegExp(“([^?=&]+)(=([^&]*))?”,“g”), 函数($0,$1,$2,$3){result[$1]=decodeURI($3);}); 返回结果; }; var args=getopts(loc
});代码>您正在更改变量,但没有对其执行任何操作。按照本教程的说明,这是您需要执行的操作
function changeImage(hatUri, offsetXPercent, offsetYPercent, widthPercent, heightPercent) {
filter.setOverlayedImage(hatUri, offsetXPercent, offsetYPercent, widthPercent, heightPercent,
function(error) {
if (error) return onError(error);
console.log("Set overlay image");
});
}
我强烈建议您学习这些示例,并理解每一行代码。如果您在客户端中更改了一个值,但没有指示媒体服务器也更改该值,那么这是没有用的