我正在开发GWT应用程序。我需要在我的应用程序中嵌入YouTube视频。
我试过BST播放器API,但是我没有成功地提出播放器上的视频。
我已经下载BST Player.jar
,并把它添加到我的构建路径,然后继承下面的罐子在gwtapp.gwt.xml
:在GWT(BST播放器API)中嵌入youtube播放器
**inherits name ='com.bramosystems.oss.player.core.Core'**
**inherits name ='com.bramosystems.oss.player.youtube.YouTube'**
然后我试图BST页上给出的例子:
simplePanel = new SimplePanel();
add(simplePanel);
simplePanel.setSize("", "");
try {
// create the player, specifing URL of media
player = new ChromelessPlayer("http://www.youtube.com/watch?v=O3CZFfyed3M", "80%", "350px");
CustomPlayerControl cpc = new CustomPlayerControl(player);
FlowPanel fp = new FlowPanel();
fp.add(player);
fp.add(cpc);
simplePanel.setWidget(fp); // add player and custom control to panel.
} catch (PluginVersionException e) {
// required Flash plugin version is not available,
// alert user possibly providing a link to the plugin download page.
simplePanel.setWidget(new HTML(".. some nice message telling the " + "user to download plugin first .."));
} catch(PluginNotFoundException e) {
// required Flash plugin not found, display a friendly notice.
simplePanel.setWidget(PlayerUtil.getMissingPluginNotice(e.getPlugin()));
}
我能看到与YouTube播放器面板,但我看不到视频加载或播放。我试过player.playMedia()
,这没有帮助。有关如何继续并制作视频的任何想法?
真棒!谢谢。 – Ashok
这是非常有帮助的,但是我在视频中看到黑线,任何方式我都可以删除它..? –
我用这个只有简单的框架 - 它工作正常,请参考这个 http://stackoverflow.com/questions/14812679/vimeo-embedding-in-gwt –