开发者

Offline testing of the Youtube player

We have several integration tests (Cucumber driving Selenium) that work with Youtube videos. Sometimes Youtube is down or slow which causes hiccups in the integration tests.

Has anyone succeeded i开发者_如何学Gon self-hosting the Youtube chrome, movies it plays, or both?

Thanks!


Our approach was to write a mock Youtube player that responded to all of the same API calls and mimicked the behaviour of Youtube's player (e.g. getDuration() ticks up after the play button is pushed, etc.). It took our ActionScript guru a couple of hours to write.

Here's a link to Youtube's JavaScript API docs for anyone who might go down this path:

http://code.google.com/apis/youtube/js_api_reference.html

Most of the methods do nothing, however there are a few with side-effects (e.g. the previously-mentioned getDuration() returns the real duration as the video would be 'playing').

Rob

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜