Advertisement
Looong

main.cpp

Aug 27th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1. #define BOOST_SIGNALS_NO_DEPRECATION_WARNING
  2.  
  3. #include <Wt/WApplication>
  4. #include <Wt/WBreak>
  5. #include <Wt/WContainerWidget>
  6. #include <Wt/WFileResource>
  7. #include <Wt/WMediaPlayer>
  8. #include <Wt/WPushButton>
  9. #include <Wt/WText>
  10.  
  11.  
  12. class StreamingServer : public Wt::WApplication
  13. {
  14. public:
  15.   StreamingServer(Wt::WEnvironment const &env);
  16.   static StreamingServer *create(Wt::WEnvironment const &env);
  17.  
  18. private:
  19.   Wt::WMediaPlayer *_mediaPlayer;
  20.   Wt::WFileResource *_file;
  21. };
  22.  
  23. StreamingServer::StreamingServer(Wt::WEnvironment const &env)
  24.   :
  25.   WApplication(env),
  26.   _file(new Wt::WFileResource("vid.mp4"))
  27. {
  28.   _mediaPlayer = new Wt::WMediaPlayer(Wt::WMediaPlayer::Video, root());
  29.   _mediaPlayer->addSource(Wt::WMediaPlayer::M4V, _file);
  30.   _mediaPlayer->addSource(Wt::WMediaPlayer::M4A, _file);
  31. }
  32.  
  33. StreamingServer *StreamingServer::create(Wt::WEnvironment const &env)
  34. {
  35.   return new StreamingServer(env);
  36. }
  37.  
  38. int main(int argc, char **argv)
  39. {
  40.   return Wt::WRun(argc, argv, &StreamingServer::create);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement