Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/394.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用jquery和Kurento更改图像源_Javascript_Jquery_Kurento - Fatal编程技术网

Javascript 使用jquery和Kurento更改图像源

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

我使用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_服务器:未定义 }
});您正在更改变量,但没有对其执行任何操作。按照本教程的说明,这是您需要执行的操作

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");
      });
}
我强烈建议您学习这些示例,并理解每一行代码。如果您在客户端中更改了一个值,但没有指示媒体服务器也更改该值,那么这是没有用的