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.

Example
source
#include <Wt/WContainerWidget.h>
#include <Wt/WImage.h>
#include <Wt/WFlashObject.h>

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

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

auto flash =
    container->addWidget(Wt::cpp14::make_unique<Wt::WFlashObject>("https://www.youtube.com/v/HOfdboHvshg"));
flash->setFlashParameter("allowFullScreen", "true");
flash->setAlternativeContent(Wt::cpp14::make_unique<Wt::WImage>(poster));
flash->resize(640, 360);