how to play video in vaadin?

i used both video component (Video video = new Video(“”):wink:
and embedded in vaddin(Embedded e = new Embedded(“my video”, new ExternalResource(" http://xxxx/yy.mp4"));).

it runs quite well in iphone while using safari browser, but video is not playing in my pc am using mozilla firefox browser.

What do you get instead? Any warnings from the browser? A empty box where the video should be at? Does other desktop browsers work? Is the video element in the DOM (HTML)?

i 've tested in google chrome, it shows an empty box where video is to play.

mozilla firefox : it shows like an error in setting mime type.

Hi,

Seems like according to
this article from mozilla developer network
mp4 is not supported in FF. However, Chrome should play it.


Aleksandr

I am sorry for the inconvenience,

Am getting an error message like “No video with supported format and MIME type found” while using Video component.

@Override
public void init() {
Window mainWindow = new Window(“Vaadin Application”);

	Video video = new Video( "video" ); 
	
	video.setSources( 
			new ExternalResource( "http://xxx/yy.mp4" )); 
	video.setAutoplay(true);
	video.setWidth( "640px" ); 
	video.setHeight( "360px" );
	video.setHtmlContentAllowed(true);
            
            mainWindow.addComponent(video);
	setMainWindow(mainWindow);
	setTheme("vaadintheme");
}

Runs well in Iphone-4s wit safari browser.

I have tested this with different browsers like Mozilla firefox(15.0.1), google chrome and internet explorer(version -8)

I have seen the previous posts and gone for alternative option as embedded in vaadin

@Override
public void init() {

            Window mainWindow = new Window("Vaadin Application");

            Embedded video = new Embedded("Video", new ExternalResource("http:///xxx/yy.mp4"));

	video.setType(Embedded.TYPE_OBJECT);
	video.setMimeType("application/x-shockwave-flash");
	video.setParameter("allowFullScreen", "true");
	video.setWidth("50%");
	video.setHeight("360px");

	mainWindow.addComponent(video);
	setMainWindow(mainWindow);
	setTheme("vaadintheme");
}

I have reffered the following link even,

https://developer.mozilla.org/en-US/docs/HTML/Supported_media_formats?redirectlocale=en-US&redirectslug=Media_formats_supported_by_the_audio_and_video_elements

And tried with Internet Explorer,But am getting the same results.

It shows an empty box where the video is to play, and tested this with different browsers like Internet Explorer,Google chrome and Mozilla firefox.

Thanks in Advance for your kind reply.

regards,
Aravind

It might be an issue with missing codecs on the computer or the servlet container not sending the correct MIME types. I’d suggest you do a HTML only page with the video tag in it to test if it works. If it works, serve it trough the servlet container to see if that shows the video as well.

Thank you. It works perfectly while i tried in different machines, As you said my system have no such codecs to play videos

regards,
Aravind