Commit ea2b2cd2 authored by Mehdi Sabwat's avatar Mehdi Sabwat
Browse files

main.c: update libvlc options

parent 2c7d0c0d
......@@ -11,7 +11,7 @@ libvlc_instance_t *libvlc;
libvlc_time_t t = -1;
char flag = 1;
void iter()
static void iter()
{
if (libvlc_media_player_get_time(mp) == t) {
// when enable, the js does not respond.
......@@ -45,56 +45,47 @@ int main() {
/* We don't want to the main thread stop even if the main function exit.
* If this thread stop, all proxyfied functions wont be called.
*/
EM_ASM(Module['noExitRuntime']=true);
emscripten_set_element_css_size("#canvas", 720, 540);
//emscripten_set_canvas_element_size("#canvas", 720, 540);
//emscripten_set_element_css_size("#canvas", 1080, 720);
libvlc_media_t *m;
char const *vlc_argv[] = {
"-vvv",
"--no-spu",
"--no-osd",
"-Idummy",
"--aout", "openal",
"--vout", "gles2",
"--ignore-config",
};
libvlc = libvlc_new( ARRAY_SIZE( vlc_argv ), vlc_argv );
if (libvlc == NULL)
EM_ASM(Module['noExitRuntime']=true);
emscripten_set_element_css_size("#canvas", 720, 540);
libvlc_media_t *m;
char const *vlc_argv[] = {
"-vvv",
"--no-spu",
"--no-osd",
"-Idummy",
"--ignore-config",
};
libvlc = libvlc_new( ARRAY_SIZE( vlc_argv ), vlc_argv );
if (libvlc == NULL)
{
fprintf( stderr, "unable to create libvlc instance" );
return -1;
fprintf( stderr, "unable to create libvlc instance" );
return -1;
}
m = libvlc_media_new_path( libvlc, "Dolby_Canyon.vob" );
if (m == NULL)
{
fprintf(stderr, "unable to create media");
return -1;
}
mp = libvlc_media_player_new_from_media( m );
if (mp == NULL)
{
fprintf(stderr, "unable to create media player");
return -1;
}
libvlc_media_release( m );
m = libvlc_media_player_get_media(mp);
libvlc_audio_set_volume (mp, 100);
int res = libvlc_media_player_play (mp);
if (res != 0) {
m = libvlc_media_new_path( libvlc, "./h264-sd.mp4" );
if (m == NULL)
{
fprintf(stderr, "unable to create media");
return -1;
}
mp = libvlc_media_player_new_from_media( m );
if (mp == NULL)
{
fprintf(stderr, "unable to create media player");
return -1;
}
libvlc_media_release( m );
m = libvlc_media_player_get_media(mp);
// libvlc_audio_set_volume (mp, 100);
// int res = libvlc_media_player_play (mp);
/* if (res != 0) {
fprintf( stderr, "unable to play media" );
return -1;
return -1;
}
emscripten_set_main_loop(iter, 1, 1);
return 0;
*/
emscripten_set_click_callback("#canvas", 0, 1, play_pause_handler);
emscripten_set_main_loop(iter, 1, 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment