diff options
author | Krassimir Valev <krassimir_valev@yahoo.com> | 2017-08-08 14:21:15 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-08-08 15:21:15 +0300 |
commit | e981dfbe1f782ae93844886270cac9651be5fb8d (patch) | |
tree | 90e261db1d46bf8e7a17dbe6f980956e13701dc6 /uitest | |
parent | 3766ab61c90885c8657186c4b033667dc2fa25db (diff) | |
download | vaadin-framework-e981dfbe1f782ae93844886270cac9651be5fb8d.tar.gz vaadin-framework-e981dfbe1f782ae93844886270cac9651be5fb8d.zip |
Added loop and preload attributes for media elements, fixed null poster (#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 | 27 |
1 files changed, 18 insertions, 9 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 ec4f7abd47..6fa5ac4ed6 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 @@ -16,12 +16,16 @@ package com.vaadin.tests.components.media; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; 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 { @@ -31,11 +35,9 @@ public class Media extends TestBase { 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"); + "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 +55,20 @@ public class Media extends TestBase { } })); + final CheckBox loop = new CheckBox("Loop"); + loop.addValueChangeListener(new ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + v.setLoop(loop.booleanValue()); + } + }); + 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")); + "http://www.sample-videos.com/audio/mp3/crowd-cheering.mp3")); addComponent(a); addComponent(new Button("Play audio", new ClickListener() { @@ -83,7 +92,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 |