⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (1013 Bytes)
Bug #1007
ยป test.C
Gabor Tusnady
, 10/04/2011 10:20 AM
#include
<Wt/WApplication>
#include
<Wt/WEnvironment>
#include
<Wt/WContainerWidget>
#include
<Wt/WMediaPlayer>
#include
<Wt/WLink>
#include
<Wt/WFileResource>
#include
<stdlib.h>
using
namespace
Wt
;
using
namespace
std
;
class
MyApplication
:
public
WApplication
{
public:
MyApplication
(
const
WEnvironment
&
env
)
:
WApplication
(
env
)
{
setTitle
(
"WMedia Test"
);
WMediaPlayer
::
Encoding
enc
=
WMediaPlayer
::
M4V
;
WFileResource
*
file
=
new
WFileResource
(
"/path/to/local/file.mp4"
);
WLink
link
;
link
.
setResource
(
file
);
WMediaPlayer
*
mediaplayer
=
new
WMediaPlayer
(
WMediaPlayer
::
Audio
,
root
()
);
mediaplayer
->
addSource
(
enc
,
link
);
WLink
link2
(
"http://example.com/test.mp4"
);
WMediaPlayer
*
mediaplayer2
=
new
WMediaPlayer
(
WMediaPlayer
::
Audio
,
root
()
);
mediaplayer2
->
addSource
(
enc
,
link2
);
}
};
WApplication
*
createApplication
(
const
WEnvironment
&
env
)
{
return
new
MyApplication
(
env
);
}
int
main
(
int
argc
,
char
**
argv
)
{
return
WRun
(
argc
,
argv
,
&
createApplication
);
}
(1-1/1)
Loading...