Skip to content

Instantly share code, notes, and snippets.

@emk
Created August 18, 2009 01:40
Show Gist options
  • Save emk/169490 to your computer and use it in GitHub Desktop.
Save emk/169490 to your computer and use it in GitHub Desktop.
public class MediaDemo implements EntryPoint {
String bulletHtml =
"<h3 style='display: none' id='special'>A special message</h3>" +
"<ul>" +
"<li style='display: none' id='miracles'>Modern medicine can work miracles</li>" +
"<li style='display: none' id='phony'>But there are also phony practitioners." +
" <ul>" +
" <li style='display: none' id='z-rays'>There are <i>no</i> Z-rays.</li>" +
" <li style='display: none' id='music'>You can't cure cancer with tape-recorded music.</li>" +
" <li style='display: none' id='doorbell'>What's a doorbell doctor, anyway?</li>" +
" </ul></li>" +
"<li style='display: none' id='help'>Help <span style='color: red'>stamp out</span> quackery!</li>" +
"</ul>";
public void onModuleLoad() {
AbsolutePanel stage = new AbsolutePanel();
stage.setPixelSize(800, 600);
Video video = new Video("quackery_theora.ogv");
stage.add(video, 50, 50);
stage.add(new HTMLPanel(bulletHtml), 500, 50);
stage.add(new TimeCoder(video), 50, 400);
new TimeLine(video,
new TimePoint(3.5, new ShowElementAction("special")),
new TimePoint(9.7, new ShowElementAction("miracles")),
new TimePoint(13.2, new ShowElementAction("phony")),
new TimePoint(21.4, new ShowElementAction("z-rays")),
new TimePoint(28.2, new ShowElementAction("music")),
new TimePoint(36.5, new ShowElementAction("doorbell")),
new TimePoint(48.4, new ShowElementAction("help")));
RootPanel.get().add(stage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment