Commit cb313ae1 authored by Daniel Amm's avatar Daniel Amm Committed by Jean-Baptiste Kempf

npapi: add attribute 'volume'

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 21b673f8
......@@ -124,6 +124,7 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
bool b_autoloop = false;
bool b_mute = false;
int i_volume = -1;
/* parse plugin arguments */
for( int i = 0; (i < argc) && (ppsz_argc < MAX_PARAMS); i++ )
......@@ -156,6 +157,10 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
{
b_mute = boolValue( argv[i] );
}
else if( !strcmp( argn[i], "volume" ) )
{
i_volume = atoi( argv[i] );
}
else if( !strcmp( argn[i], "loop")
|| !strcmp( argn[i], "autoloop") )
{
......@@ -190,6 +195,9 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
if( b_mute )
m_player.get_mp().setMute( true );
if( i_volume >= 0 && i_volume <= 200 )
m_player.get_mp().setVolume( i_volume );
/*
** fetch plugin base URL, which is the URL of the page containing the plugin
** this URL is used for making absolute URL from relative URL that may be
......
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