开发者

How to embed my recent video shared on YouTube?

Tried to read the official guide about embedding video on my website, but I don't find the part which teach how to embed the last video loaded on my youtube zone.

Is it possible (using JS API)?

EDIT Callback for check a video and do some things

<head>
    <script type="text/javascript" src="http://gdata.youtube.com/feeds/users/MyNickname/uploads?alt=json-in-script&format=5&callback=showMyVideos"></script>

    <script type="text/javascript">
        function showMyVideos(d开发者_StackOverflow中文版ata) {
            alert("Hello");
        }
    </script>         
</head>

this should show my alert, but nothing happens. Why=


You could use the following URL to get the list of uploaded video by particular user in JSON format.

http://gdata.youtube.com/feeds/users/GoogleDevelopers/uploads?alt=json

Note : alt=json and to replace GoogleDevelopers with your user.

You could use jQuery.ajax() to get the data from the URL then just get the first feed (the latest one)


You'll want to use this section of the YT Data API. The order of returned videos is most recently uploaded first, so you can just grab the first off the returned list.

For example:

https://gdata.youtube.com/feeds/api/users/SocialGo/uploads?alt=json&fields=entry/id,entry/published

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜