Vid plays, but why are controls disabled ?

This forum is about all development around libVLC.
markgilmore
New Cone
New Cone
Posts: 8
Joined: 12 Oct 2009 19:19

Vid plays, but why are controls disabled ?

Postby markgilmore » 12 Oct 2009 19:39

the code below plays the file fine, and the buttons/controls are all there
(play/stop/scroll/etc), but they are all *disabled* for some reason
(i can close, the window, but that's it).
the only way i can control the playback is via my pgm.

very tired of banging head against wall - any advice would be greatly appreciated !

also:
it would also be great if i could play a file *within* the existing VLC gui
(as if i selected/played a file the "normal" way).
but it appears that the only way i can play files via a pgm as to
create a new/dedicated instance.
is there a way i can play a file (via a pgm) just as if the user played it "manually" ?
and is there a way that one can *passively* monitor vlc activities ?
i.e. can i passively monitor what is being played ?

thanks,
mark

------
const char * const vlc_args[] = {
"--plugin-path=c:\\program files\\videolan\\vlc\\plugins",
0};

libvlc_exception_t ex;
libvlc_instance_t * inst;
libvlc_media_player_t *my_media_player;
libvlc_media_t *my_media;

libvlc_exception_init(&ex);
inst = libvlc_new(1, vlc_args, &ex);

my_media = libvlc_media_new(inst, arg[1], &ex);

my_media_player = libvlc_media_player_new(inst, &ex);
libvlc_media_player_set_media(my_media_player, my_media, &ex);

libvlc_add_intf(inst, "qt4", &ex); // ??: IF I DON'T DO THIS, I CANNOT EVEN CLOSE WINDOW

libvlc_media_player_play(my_media_player, &ex);

while (! kbhit())
{
Sleep(100);
}

libvlc_media_player_stop(my_media_player, &ex);
libvlc_media_release(my_media); // ??:"No need to keep the media now"
libvlc_media_player_release(my_media_player);
libvlc_release(inst);

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Vid plays, but why are controls disabled ?

Postby Rémi Denis-Courmont » 12 Oct 2009 20:05

The builtin UI plugins use the VLC core playlist. You are using the media player API.

When you click on UI controls, nothing happens since the VLC core playlist is empty. You can fill it by passing parameters to libvlc_new(), but it will never interwork with custom media player objects.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

markgilmore
New Cone
New Cone
Posts: 8
Joined: 12 Oct 2009 19:19

Re: Vid plays, but why are controls disabled ?

Postby markgilmore » 12 Oct 2009 22:05

Thanks a lot for the info.
Trying not to appear dumb, but i am really quite lost.
Perhaps I could bother you with 2 more questions ?:

What I am really after is the ability to control/monitor VLC from my pgm
**such that the "normal" VLC controls still work** (just as i do with WinAmp).
I.E. start playpack of a file, but still be able to stop/pause/etc with the normal controls
(just as if i manually selected/played the file via VLC itself).
Is this possible ?

Related:
when i use libvlc_playlist (deprecated), the file plays *and* the controls work
(though i can't figure out how to monitor anything):
int item = libvlc_playlist_add(inst, filename, NULL, &ex);
libvlc_playlist_play (inst, item, 0, NULL, &ex);

but when i use media_list, the controls are disabled (though i *can* monitor the playback):
libvlc_media_list_t *my_media_list = libvlc_media_list_new(inst, &ex);
libvlc_media_t *media = libvlc_media_new(inst, filename, &ex);
libvlc_media_list_add_media(my_media_list, media, &ex);
libvlc_media_list_player_t *my_media_list_player = libvlc_media_list_player_new(inst, &ex);
libvlc_media_list_player_set_media_list(my_media_list_player, my_media_list, &ex);
libvlc_media_list_player_play(my_media_list_player, &ex);

is there a way to replicate the libvlc_playlist behavior (controls working) with media_list ?

pl note that as i am ***very*** green w VLC, the more details the better :-).

thanks,
mark

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Vid plays, but why are controls disabled ?

Postby Rémi Denis-Courmont » 13 Oct 2009 17:15

What I am really after is the ability to control/monitor VLC from my pgm
**such that the "normal" VLC controls still work** (just as i do with WinAmp).
I.E. start playpack of a file, but still be able to stop/pause/etc with the normal controls
(just as if i manually selected/played the file via VLC itself).
Is this possible ?
This is possible with an interface plugin for VLC itself. This is not going to work by using LibVLC.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

huanjo
New Cone
New Cone
Posts: 3
Joined: 14 Feb 2016 17:24

Re: Vid plays, but why are controls disabled ?

Postby huanjo » 14 Feb 2016 17:34

The builtin UI plugins use the VLC core playlist. You are using the media player API.
When you click on UI controls, nothing happens since the VLC core playlist is empty. You can fill it by passing parameters to libvlc_new(), but it will never interwork with custom media player objects.
If you fill the VLC core playlist by passing parameters to the builtin UI using libvlc_new() and therefore creating the instance, is it possible to register for events from the builtin UI/VLC core playlist on the instance?

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Vid plays, but why are controls disabled ?

Postby Rémi Denis-Courmont » 14 Feb 2016 17:37

No.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 24 guests