开发者

recognize a media url and include it in your html with javascript

I know that some sites like youtube or grooveshark allow to include an iFrame or an swf to reproduce a media开发者_运维问答 link playing it from the same page where code were injected (something like facebook). Is already something that someone has already written to detect which is the site you are going to include and then load into page a related preview object? thanks


I assume you're referring to something like the WPAudio Wordpress plugin, which lets you put a link to an MP3 file, and it will automatically render a nice audio player.

If so, you probably just need to look into Regular Expressions. You will need to write a number of regular expressions to detect the specific media types you're interested in supporting. When you load your content, run the regexes against the content, and if found, replace it with the appropriate embed/object tags, or whatever your preview object is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜