Another problem that I have is switching NSView while playing a stream.
I'm writing a crossplatform app but below I placed MacOS version of code. I assume that solution for this OS will be portable so I can use it on other systems.
The issue is that I'm using Phonon VideoWidget (Qt4) because it has build in fullscreen functionality ...but when I call "enterFullScreen" function the widget's "winId" is changed and vlc media player has still assigned the old one "winId". After entering a fullscreen mode I see only black background of Phonon's VideoWidget.
Second use of "libvlc_media_player_set_nsobject" function is useless without stopping media player. The code below shows my temporary solution but it uses stop/assign new nsobject/play concept and it costs extra time for new stream connection.
Code: Select all
// Constructor of the window
const char * const vlc_args[] = {
"-I", "dummy",
"--ignore-config",
"--extraintf=logger",
"--verbose=2",
"--no-video-title-show"
};
inst = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);
m = libvlc_media_new_path (inst, "http://path.to/asf/stream/source");
mp = libvlc_media_player_new_from_media (m);
widget = new Phonon::VideoWidget(this);
...
// Play button
libvlc_media_player_set_nsobject (mp, (void *) widget->winId());
libvlc_media_player_play(mp);
...
// Fullscreen button
libvlc_media_player_stop(mp);
widget->enterFullScreen();
libvlc_media_player_set_nsobject (mp, (void *) widget->winId());
libvlc_media_player_play(mp);