Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.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
C#如何通过点击按钮暂停视频(webBrowser)_C#_.net_Winforms - Fatal编程技术网

C#如何通过点击按钮暂停视频(webBrowser)

C#如何通过点击按钮暂停视频(webBrowser),c#,.net,winforms,C#,.net,Winforms,我需要一件小事的帮助。 我尝试用按钮单击暂停嵌入webBrowser1对象中的YouTube视频 我该怎么做?这是我的密码: stringurl=”https://www.youtube.com/watch?v=gT35P_lrCCg"; 字符串html=“”; html+=“”; html+=“”; html+=“”; this.webBrowser1.DocumentText=string.Format(html,url.Split('=')[1]); 另外,我还有另一个按钮,名为clos

我需要一件小事的帮助。
我尝试用
按钮单击
暂停嵌入
webBrowser1
对象中的YouTube视频

我该怎么做?这是我的密码:

stringurl=”https://www.youtube.com/watch?v=gT35P_lrCCg";
字符串html=“”;
html+=“”;
html+=“”;
html+=“”;
this.webBrowser1.DocumentText=string.Format(html,url.Split('=')[1]);
另外,我还有另一个
按钮
,名为
close

它的操作是隐藏播放视频的
面板
,但隐藏该面板不会停止视频并继续播放

我做了一个投资组合-

你检查了所有/任何一个吗?没有希望,我检查了:(
var playElement=webBrowser1.Document.GetElementsByTagName(“按钮”).OfType().FirstOrDefault(elm=>elm.GetAttribute(“className”).Equals(“ytp播放按钮ytp按钮”);playElement?.InvokeMember(“单击”)
@Jimi它不能修复我你检查了所有/任何一个吗?是的,没有希望,我检查了:(
var playement=webBrowser1.Document.GetElementsByTagName(“BUTTON”).OfType().FirstOrDefault(elm=>elm.GetAttribute(“className”).Equals(“ytp play BUTTON ytp BUTTON”);playement?.InvokeMember(“click”);
@Jimi它不能修复它