YouTube videos
Posted: 31 Mar 2015 21:02
Hi there,
I just got my feet wet with vibVLC, and I would appreciate any help on the following problem:
I wrote a little app to play videos which works fine on all test I did except when playing YouTube videos
I handle YouTube urls just as any other url, but with YouTube when the program reaches the state libvlc_Playing I immediately receive event
libvlc_MediaStateChanged and when I check the player state it is set to libvlc_Error.
The same url plays fine with the VLC player, so the problem is definitely in my code.
the seq of VLC calls is the following: ( i pass the YT url as follows: https://www.youtube.com/watch?v=00x6uqY555Q )
inst = libvlc_new (0, NULL);
libvlc_log_set(inst, log_cb, NULL );
vlc_m = libvlc_media_new_location(inst, url ) ;
libvlc_media_parse(vlc_m) ;
vlc_mp = libvlc_media_player_new_from_media(vlc_m);
libvlc_event_manager_t *e_play = libvlc_media_player_event_manager( vlc_mp ) ;
libvlc_event_manager_t *e_media = libvlc_media_event_manager( vlc_m );
libvlc_event_attach(e_media, libvlc_MediaStateChanged, event_callback, NULL );
libvlc_media_player_play( vlc_mp );
while ( libvlc_media_get_state( vlc_m ) <= libvlc_Playing )
{
do something ..
}
Can some one tell me if I am missing something on the above code?
I have turned on the VLC logs but I do not see anything suspicious (all logs are level 0)
Thank you for any help you can give me.
regards, gt
I just got my feet wet with vibVLC, and I would appreciate any help on the following problem:
I wrote a little app to play videos which works fine on all test I did except when playing YouTube videos
I handle YouTube urls just as any other url, but with YouTube when the program reaches the state libvlc_Playing I immediately receive event
libvlc_MediaStateChanged and when I check the player state it is set to libvlc_Error.
The same url plays fine with the VLC player, so the problem is definitely in my code.
the seq of VLC calls is the following: ( i pass the YT url as follows: https://www.youtube.com/watch?v=00x6uqY555Q )
inst = libvlc_new (0, NULL);
libvlc_log_set(inst, log_cb, NULL );
vlc_m = libvlc_media_new_location(inst, url ) ;
libvlc_media_parse(vlc_m) ;
vlc_mp = libvlc_media_player_new_from_media(vlc_m);
libvlc_event_manager_t *e_play = libvlc_media_player_event_manager( vlc_mp ) ;
libvlc_event_manager_t *e_media = libvlc_media_event_manager( vlc_m );
libvlc_event_attach(e_media, libvlc_MediaStateChanged, event_callback, NULL );
libvlc_media_player_play( vlc_mp );
while ( libvlc_media_get_state( vlc_m ) <= libvlc_Playing )
{
do something ..
}
Can some one tell me if I am missing something on the above code?
I have turned on the VLC logs but I do not see anything suspicious (all logs are level 0)
Thank you for any help you can give me.
regards, gt