Commit c03f5fee authored by Damien Fouilleul's avatar Damien Fouilleul

- mozilla: misc fixes

parent 06e05c1d
......@@ -556,6 +556,7 @@ const NPUTF8 * const LibvlcPlaylistNPObject::methodNames[] =
{
"add",
"play",
"playItem",
"togglePause",
"stop",
"next",
......@@ -570,6 +571,7 @@ enum LibvlcPlaylistNPObjectMethodIds
{
ID_add,
ID_play,
ID_playItem,
ID_togglepause,
ID_stop,
ID_next,
......@@ -695,6 +697,23 @@ RuntimeNPObject::InvokeResult LibvlcPlaylistNPObject::invoke(int index, const NP
}
}
return INVOKERESULT_NO_SUCH_METHOD;
case ID_playItem:
if( (argCount == 1) && isNumberValue(args[0]) )
{
libvlc_playlist_play(p_plugin->getVLC(), numberValue(args[0]), 0, NULL, &ex);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
else
{
VOID_TO_NPVARIANT(result);
return INVOKERESULT_NO_ERROR;
}
}
return INVOKERESULT_NO_SUCH_METHOD;
case ID_togglepause:
if( argCount == 0 )
{
......
......@@ -93,8 +93,7 @@ NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value )
return NPERR_NO_ERROR;
case NPPVpluginDescriptionString:
snprintf( psz_desc, sizeof(psz_desc)-1, PLUGIN_DESCRIPTION, VLC_Version() );
psz_desc[sizeof(psz_desc)-1] = 0;
snprintf( psz_desc, sizeof(psz_desc), PLUGIN_DESCRIPTION, VLC_Version() );
*((char **)value) = psz_desc;
return NPERR_NO_ERROR;
......
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