开发者

Any php code to make embed code of video?

开发者 https://www.devze.com 2022-12-23 03:17 出处:网络
I Want a php code to turn a youtube/dailymotion/vimeo/metacafe... URL into an EMBEDABLE code so i can show it using echo , it is really hard to read the API of every website, so i\'m wondering if ther

I Want a php code to turn a youtube/dailymotion/vimeo/metacafe... URL into an EMBEDABLE code so i can show it using echo , it is really hard to read the API of every website, so i'm wondering if there is a class or code to do this.

Note: if there isn't anyon开发者_运维百科e, then maybe a jQuery facebox alternative who supports more than youtube.

Thanks


it's not so difficult.

youtube link is like this http://www.youtube.com/watch?v=XXXX where XXXX is the video ID.

and this is the code for embedding the video

<object width="480" height="385">
<param name="movie" value="http://www.youtube.com/v/XXXX&hl=en_US&fs=1&">
</param>
<param name="allowFullScreen" value="true">
</param>
<param name="allowscriptaccess" value="always">
</param>
<embed src="http://www.youtube.com/v/XXXX&hl=en_US&fs=1&" 
type="application/x-shockwave-flash" allowscriptaccess="always" 
allowfullscreen="true" width="480" height="385"></embed>
</object>

you only need to parse (ie. using php) the youtube links and then insert the found id insted of XXXX

0

精彩评论

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