npapi-vlc | branch: master | Daniel Amm <[email protected]> | Fri May 29 15:27:35 2015 +0200| [cb313ae17583e4eedfd09ae58c3f6cb95daad4a6] | committer: Jean-Baptiste Kempf
npapi: add attribute 'volume' Signed-off-by: Jean-Baptiste Kempf <[email protected]> > https://code.videolan.org/videolan/npapi-vlc/commit/cb313ae17583e4eedfd09ae58c3f6cb95daad4a6 --- npapi/vlcplugin_base.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp index bfefdbf..6e5bd9f 100644 --- a/npapi/vlcplugin_base.cpp +++ b/npapi/vlcplugin_base.cpp @@ -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 _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
