summaryrefslogtreecommitdiffstats
path: root/tests/src/com
diff options
context:
space:
mode:
authorJonatan Kronqvist <jonatan.kronqvist@itmill.com>2011-09-07 11:49:09 +0000
committerJonatan Kronqvist <jonatan.kronqvist@itmill.com>2011-09-07 11:49:09 +0000
commit1300d93c35dc4e9eb20fe589cdddc3a4c0b9c735 (patch)
tree1f76b5fb6d9291ebeed95520b6d61f7155c9a4aa /tests/src/com
parentf65e90d979d1ebacbef35d058b0bbf8e0349d0e3 (diff)
downloadvaadin-framework-1300d93c35dc4e9eb20fe589cdddc3a4c0b9c735.tar.gz
vaadin-framework-1300d93c35dc4e9eb20fe589cdddc3a4c0b9c735.zip
HTML5 <audio> and <video> support #6909
svn changeset:20904/svn branch:6.7
Diffstat (limited to 'tests/src/com')
-rw-r--r--tests/src/com/vaadin/tests/components/media/Media.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/media/Media.java b/tests/src/com/vaadin/tests/components/media/Media.java
new file mode 100644
index 0000000000..ff25810042
--- /dev/null
+++ b/tests/src/com/vaadin/tests/components/media/Media.java
@@ -0,0 +1,74 @@
+package com.vaadin.tests.components.media;
+
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Audio;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Video;
+
+public class Media extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Video v = new Video("video");
+ v.setSources(
+ new ExternalResource(
+ "http://jonatan.virtuallypreinstalled.com/media/big_buck_bunny.mp4"),
+ new ExternalResource(
+ "http://jonatan.virtuallypreinstalled.com/media/big_buck_bunny.ogv"));
+ v.setWidth("640px");
+ v.setHeight("360px");
+ addComponent(v);
+ addComponent(new Button("Play video", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ v.play();
+ }
+
+ }));
+ addComponent(new Button("Pause video", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ v.pause();
+ }
+
+ }));
+
+ final Audio a = new Audio("audio");
+ a.setSources(
+ new ExternalResource(
+ "http://jonatan.virtuallypreinstalled.com/media/audio.mp3"),
+ new ExternalResource(
+ "http://jonatan.virtuallypreinstalled.com/media/audio.ogg"));
+ addComponent(a);
+
+ addComponent(new Button("Play audio", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ a.play();
+ }
+
+ }));
+ addComponent(new Button("Pause audio", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ a.pause();
+ }
+
+ }));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Video and audio files should play using the HTML5 elements. "
+ + "(Movie is (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org)";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6909;
+ }
+
+}