Media — video, audio, PDF and other resources

Flash object

Although a media player like WMediaPlayer is usually used to play video, you may also choose a WFlashObject to play video. In the example below the YouTube flash player is used. If flash is not supported on your system, a static image is shown.

#include <Wt/WContainerWidget.h>
#include <Wt/WImage.h>
#include <Wt/WLink.h>
#include <Wt/WFlashObject.h>

// Define poster image location
std::string poster = "pics/sintel_trailer.jpg";

auto container = std::make_unique<Wt::WContainerWidget>();

auto flash = container->addNew<Wt::WFlashObject>("");
flash->setFlashParameter("allowFullScreen", "true");
flash->resize(640, 360);