Vimeo嵌入到gwt中 [英] Vimeo embedding in gwt

查看:84
本文介绍了Vimeo嵌入到gwt中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用gwt嵌入视频,但我意识到gwt不允许iframe. Vimeo建议使用此类代码进行嵌入.有没有其他方法可以做到这一点?

I tried to embed a video using gwt but I realized that gwt doesn't allow iframe. Vimeo suggests to use this kind of code for embedding. Is there an alternative way to do this?

补充

得到答案后,我意识到我想向HTML元素中添加<frame>代码,但这不起作用,但Frame可以起作用,如下所述.

After getting the answers I realized that I wanted to add <frame> code to an HTML element and that does not work but Frame works as it is said below.

推荐答案

GWT Frame类包装了IFrame,您可以在下面的javadoc链接中找到使用示例.

The GWT Frame class wraps an IFrame and you can find the example use in the javadoc link below.

GWT是2.5版本,而不是1.5版本.最新Frame文档的链接为- http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Frame.html

GWT is in 2.5 version and not 1.5. The link to latest Frame documentation is - http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Frame.html

public class FrameExample implements EntryPoint {
    public void onModuleLoad() {
        // Make a new frame, and point it at Google.
        Frame frame = new Frame("http://player.vimeo.com/video/"+VIDEO_ID);

        // Add it to the root panel.
        RootPanel.get().add(frame);
   }
}

如果您需要使用第三方库,则可以使用BST Player.利用BST Player中的Vimeo GWT包装器-

If you need to go for third party library then you can BST Player. Make use of Vimeo GWT wrappers from BST Player - http://code.google.com/p/bst-player/source/browse/#svn%2Ftrunk%2Fvimeo-player-provider

我宁愿建议您仅使用GWT Frame API,除非您需要BST播放器提供的其他功能,否则不要使用任何第三方.

I would rather suggest you to stick to GWT Frame api only and not use any third party unless you need some other feature provided by the BST player.

这篇关于Vimeo嵌入到gwt中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆