【发布时间】:2010-11-10 16:51:19
【问题描述】:
是否有正则表达式可以从 youtube 视频页面链接中获取 youtube 嵌入代码?
我想要这个问题的反面: Getting youtube links from embedded youtube video on pages?
编辑: 我需要如下代码:
public static String GetYoutubeEmbedCode(String YoutubeLink)
{
String SourceLink = /* Something involving YoutubeLink*/;
String YoutubeEmbedCode = "<object width=\"640\" height=\"385\"><param name=\"movie\" value=\"" + SourceLink + "\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"" + SourceLink + "\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"640\" height=\"385\"></embed></object>";
return YoutubeEmbedCode;
}
【问题讨论】:
-
你能告诉我们源文本是什么样的吗?然后你在搜索什么?