[vlc-devel] Mozilla plugin - A patch of questions
James MacLean
macleajb at ednet.ns.ca
Fri Apr 23 14:47:41 CEST 2004
To make the Mozilla plugin act more in line with expectations here, I have
added a variable p_plugin->p_url_active which basically tracks and calls
NPN_DestroyStream(instance, stream, NPRES_DONE) when a user clicks on a
movie link. Otherwise, both VLC and Mozilla try to download the stream and
Mozilla updates the playlist with it's stream which doesn't play :(.
I realize this is the wrong way to correct the problem, but I still do not
understand plugins enough to suggest the correct approach. But I offer
this patch as with it you can use VLC both in the embeds and straight off
links to movies. It still appears that even with the NPN_DestroyStream
call, Mozilla continues to download it's stream unless you hit esc or the
Stop button :(, but it allows VLC to use the one in it's playlist and
show the movie. This is a problem on low bandwidth sites that can only
handle a single stream but get hit with 2 unless they know to stop the
second one ;(.
Also, what is the purpose of the p_plugin->b_stream variable?
I also saw a problem where once fullscreen() was selected, the plugin
would always revert to fullscreen for content on the page, so I added the:
+ value.b_bool = VLC_FALSE;
+ VLC_Set( p_plugin->i_vlc, "conf::fullscreen", value );
part to reset it and I don't see the problem anymore. Again, I expect this
was an incorrect effort, but seems to work for me :).
How does one get/set values in the Mozilla about:config area from the
plugin?
Instead of defaulting to using VLC for all video types it is setup for,
does the plugin interface allow for registering mime types that the plugin
might read from this config area? I ask as one might not want VLC to
handle all mime types that it can and it would be good if you could list
the ones you want somewhere instead of compiling your own personal plugin
with the types you want.
--- mozilla/ovlcshell.cpp 2004-04-23 09:09:45.840077640 -0300
+++ mozilla/vlcshell.cpp 2004-04-19 06:32:55.000000000 -0300
@@ -353,9 +353,12 @@
#endif /* USE_LIBVLC */
+ p_plugin->p_url_active = VLC_FALSE;
p_plugin->b_stream = VLC_FALSE;
p_plugin->b_autoplay = VLC_FALSE;
p_plugin->psz_target = NULL;
+ value.b_bool = VLC_FALSE;
+ VLC_Set( p_plugin->i_vlc, "conf::fullscreen", value );
for( i = 0; i < argc ; i++ )
{
@@ -624,9 +627,15 @@
#if USE_LIBVLC
VLC_AddTarget( p_plugin->i_vlc, p_plugin->psz_target,
0, 0, i_mode, PLAYLIST_END );
+ VLC_Play( p_plugin->i_vlc );
#endif
- p_plugin->b_stream = VLC_TRUE;
+// p_plugin->b_stream = VLC_TRUE;
+ p_plugin->p_url_active = VLC_TRUE;
+ } else {
+ p_plugin->p_url_active = VLC_FALSE;
}
+ } else {
+ p_plugin->p_url_active = VLC_FALSE;
}
return NPERR_NO_ERROR;
@@ -723,6 +732,11 @@
#if USE_LIBVLC
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
+ if(p_plugin->p_url_active) {
+ NPN_DestroyStream(instance, stream, NPRES_DONE);
+ return;
+ }
+
VLC_AddTarget( p_plugin->i_vlc, fname, 0, 0,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
#endif
--- mozilla/ovlcplugin.h 2004-04-23 09:25:44.745301888 -0300
+++ mozilla/vlcplugin.h 2004-04-09 23:09:33.000000000 -0300
@@ -65,6 +65,7 @@
int b_stream;
int b_autoplay;
char * psz_target;
+ int p_url_active;
private:
NPP p_instance;
-----------
JES
--
James B. MacLean macleajb at ednet.ns.ca
Department of Education
Nova Scotia, Canada
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>
More information about the vlc-devel
mailing list