在 Vaadin 中播放视频 [英] Play video in Vaadin
本文介绍了在 Vaadin 中播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 Vaadin 的初学者,播放视频时遇到问题.尽管我设置了固定尺寸,但视频始终以视频的文件大小播放.任何人都可以帮助我吗?非常感谢!
I'm a beginner with Vaadin, and I have a problem when play video. The video always plays with file size of video although I set fixed dimensions. Anyone can help me? Thanks so much!
我的代码:
public class VideoPreview extends CssLayout{
Video video;
public VideoPreview(String uri) {
video = new Video(null, new ExternalResource(uri, "video/mp4"));
video.setAltText("Can't play video");
video.setAutoplay(true);
video.setWidth("320px");
video.setHeight("265px");
addComponent(video);
}
}
推荐答案
你能从 vaadin
采样器中检查这段代码吗:
Can you check this code from vaadin
sampler :
Embedded e = new Embedded(null, new ExternalResource(
"http://www.youtube.com/v/meXvxkn1Y_8&hl=en_US&fs=1&"));
e.setAlternateText("Vaadin Eclipse Quickstart video");
e.setMimeType("application/x-shockwave-flash");
e.setParameter("allowFullScreen", "true");
e.setWidth("320px");
e.setHeight("265px");
addComponent(e);
它对我来说既适用于 chrome 也适用于 Firefox.我认为您的 Firefox 插件可能会导致此问题.
It works for me both chrome and firefox. I think your firefox addons may cause this problem.
这篇关于在 Vaadin 中播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文