diff options
author | Henri Sara <henri.sara@gmail.com> | 2017-08-09 10:24:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-09 10:24:04 +0300 |
commit | 40547e6914cd62ba6a718c00a2117451bf25c36d (patch) | |
tree | 28ae257d2e4890552317b429e67ae9ade30991ef /uitest | |
parent | 8ca1f5a677d4156b999942c852dc9fcb9eaf0e79 (diff) | |
download | vaadin-framework-40547e6914cd62ba6a718c00a2117451bf25c36d.tar.gz vaadin-framework-40547e6914cd62ba6a718c00a2117451bf25c36d.zip |
Add loop and preload attributes for media elements, fix null poster (#9797)
Picked from #9161
Fixes #7261
Fixes #5178
Fixes #4409
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/media/Media.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/media/Media.java b/uitest/src/main/java/com/vaadin/tests/components/media/Media.java index 33e783ab36..aadd98b8ce 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/media/Media.java +++ b/uitest/src/main/java/com/vaadin/tests/components/media/Media.java @@ -17,11 +17,13 @@ package com.vaadin.tests.components.media; import com.vaadin.server.ExternalResource; +import com.vaadin.shared.ui.PreloadMode; 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.CheckBox; import com.vaadin.ui.Video; public class Media extends TestBase { @@ -29,13 +31,10 @@ 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"); + v.setSources(new ExternalResource( + "http://techslides.com/demos/sample-videos/small.ogv")); + v.setWidth("560px"); + v.setHeight("320px"); addComponent(v); addComponent(new Button("Play video", new ClickListener() { @@ -53,13 +52,14 @@ public class Media extends TestBase { } })); + final CheckBox loop = new CheckBox("Loop"); + loop.addValueChangeListener(event -> v.setLoop(event.getValue())); + addComponent(loop); + v.setPreload(PreloadMode.METADATA); 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")); + a.setSources(new ExternalResource( + "http://www.sample-videos.com/audio/mp3/crowd-cheering.mp3")); addComponent(a); addComponent(new Button("Play audio", new ClickListener() { @@ -83,7 +83,7 @@ public class Media extends TestBase { @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)"; + + "(Movie is from http://techslides.com/sample-webm-ogg-and-mp4-video-files-for-html5)"; } @Override |