LibVLC media player within Juce

Yosvanissc,

How and where are you adding your VideoVLC component? Can you post or send to me.

This is how I am adding my DocumentWindow, when the user launches the media player:

                } else if (result == 3) {

                        // user picked video tutorials
                        mediaWindow = new MediaWindow();

                }

Then this is MediaWindow.h:

#include "VideoComponent.h"

class MediaWindow : public DocumentWindow
{

public:
        MediaWindow()
                : DocumentWindow(T("Video Player"),
                        Colours::lightgrey,
                        DocumentWindow::allButtons,
                        true)
        {
                VideoComponent* videos = new VideoComponent();
                setContentComponent(videos, true, true);
                centreWithSize(getWidth(),getHeight());
                setVisible(true);
                setResizable(true,true);
        }

        ~MediaWindow()
        {

        }

        void closeButtonPressed()
        {
                delete this;
        }
};

Then I think you’ve already seen the rest, the VideoComponent is set as the content component, and VideoComponent launches the LibVLC media player.

Main.cpp

*/
//#include "juce_amalgamated.h"
#include "MainComponent.h"
//#include "propuestas/ventanas.h"

//==============================================================================
/**
    This is the top-level window that we'll pop up. Inside it, we'll create and
    show a component from the MainComponent.cpp file (you can open this file using
    the Jucer to edit it).
*/
class YCCFormApp  : public DocumentWindow
{
public:
    //==============================================================================
    YCCFormApp()
        : DocumentWindow (T("VideoPlayer"),
                          Colours::lightgrey,
                          DocumentWindow::allButtons,
                          true)
    {
        // Create an instance of our main content component, and add it
        // to our window.

        MainComponent* const contentComponent = new MainComponent();

        setContentComponent(contentComponent);

        //setResizable(true,true);


        centreWithSize (getWidth(), getHeight());
        setVisible (true);

    }

    ~YCCFormApp()
    {
        // (the content component will be deleted automatically, so no need to do it here)
    }

    //==============================================================================
    void closeButtonPressed()
    {
        // When the user presses the close button, we'll tell the app to quit. This
        // window will be deleted by our HelloWorldApplication::shutdown() method
        //
        JUCEApplication::quit();
    }
};

//==============================================================================
/** This is the application object that is started up when Juce starts. It handles
    the initialisation and shutdown of the whole application.
*/
class YCCJUCEApplication : public JUCEApplication
{
    /* Important! NEVER embed objects directly inside your JUCEApplication class! Use
       ONLY pointers to objects, which you should create during the initialise() method
       (NOT in the constructor!) and delete in the shutdown() method (NOT in the
       destructor!)

       This is because the application object gets created before Juce has been properly
       initialised, so any embedded objects would also get constructed too soon.
   */
    YCCFormApp* yccFormApp;

public:
    //==============================================================================
    YCCJUCEApplication()
        : yccFormApp (0)
    {
        // NEVER do anything in here that could involve any Juce function being called
        // - leave all your startup tasks until the initialise() method.
    }

    ~YCCJUCEApplication()
    {
        // Your shutdown() method should already have done all the things necessary to
        // clean up this app object, so you should never need to put anything in
        // the destructor.

        // Making any Juce calls in here could be very dangerous...
    }

    //==============================================================================
    void initialise (const String& commandLine)
    {
        // just create the main window...
        yccFormApp = new YCCFormApp();
        yccFormApp->setBounds(100,100,800,600);
        /*  ..and now return, which will fall into to the main event
            dispatch loop, and this will run until something calls
            JUCEAppliction::quit().

            In this case, JUCEAppliction::quit() will be called by the
            hello world window being clicked.
        */
    }

    void shutdown()
    {
        // clear up..

        if (yccFormApp != 0)
            delete yccFormApp;
    }

    //==============================================================================
    const String getApplicationName()
    {
        return T("VideoPlayer");
    }

    const String getApplicationVersion()
    {
        return T("1.0");
    }

    bool moreThanOneInstanceAllowed()
    {
        return true;
    }

    void anotherInstanceStarted (const String& commandLine)
    {
    }
};
//==============================================================================
// This macro creates the application's main() function..
START_JUCE_APPLICATION (YCCJUCEApplication)

MainComponent.h

/*
  ==============================================================================

  This is an automatically generated file created by the Jucer!

  Creation date:  29 Mar 2010 2:19:21 pm

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Jucer version: 1.11

  ------------------------------------------------------------------------------

  The Jucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-6 by Raw Material Software ltd.

  ==============================================================================
*/

#ifndef __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_E426AA9D__
#define __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_E426AA9D__

//[Headers]     -- You can add your own extra header files here --
#include "juce.h"
//[/Headers]

#include "VideoVLC.h"


//==============================================================================
/**
                                                                    //[Comments]
    An auto-generated component, created by the Jucer.

    Describe your class and how it works here!
                                                                    //[/Comments]
*/
class MainComponent  : public Component,
                       public ButtonListener
{
public:
    //==============================================================================
    MainComponent ();
    ~MainComponent();

    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
    //[/UserMethods]

    void paint (Graphics& g);
    void resized();
    void buttonClicked (Button* buttonThatWasClicked);


    //==============================================================================
    juce_UseDebuggingNewOperator

private:
    //[UserVariables]   -- You can add your own custom variables in this section.
    //[/UserVariables]

    //==============================================================================
    TextButton* btnplay;
    VideoVLC* videoVLC;
    TextButton* btnstop;
    TextButton* btnpause;
    TextButton* btnload;

    //==============================================================================
    // (prevent copy constructor and operator= being generated..)
    MainComponent (const MainComponent&);
    const MainComponent& operator= (const MainComponent&);
};


#endif   // __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_E426AA9D__

MainComponent.cpp

#include "MainComponent.h"


//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]

//==============================================================================
MainComponent::MainComponent ()
    : Component (T("MainComponent")),
      btnplay (0),
      videoVLC (0),
      btnstop (0),
      btnpause (0),
      btnload (0)
{
    addAndMakeVisible (btnplay = new TextButton (T("new button")));
    btnplay->setButtonText (T("play"));
    btnplay->addButtonListener (this);

    addAndMakeVisible (videoVLC = new VideoVLC());
    addAndMakeVisible (btnstop = new TextButton (T("new button")));
    btnstop->setButtonText (T("stop"));
    btnstop->addButtonListener (this);

    addAndMakeVisible (btnpause = new TextButton (T("new button")));
    btnpause->setButtonText (T("pause"));
    btnpause->addButtonListener (this);

    addAndMakeVisible (btnload = new TextButton (T("btnload")));
    btnload->setButtonText (T("Load media"));
    btnload->addButtonListener (this);


    //[UserPreSize]
    //[/UserPreSize]

    setSize (200, 200);

    //[Constructor] You can add your own custom stuff here..
    //[/Constructor]
}

MainComponent::~MainComponent()
{
    //[Destructor_pre]. You can add your own custom destruction code here..
    //[/Destructor_pre]

    deleteAndZero (btnplay);
    deleteAndZero (videoVLC);
    deleteAndZero (btnstop);
    deleteAndZero (btnpause);
    deleteAndZero (btnload);

    //[Destructor]. You can add your own custom destruction code here..
    //[/Destructor]
}

//==============================================================================
void MainComponent::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    g.fillAll (Colour (0xff6e7071));

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}

void MainComponent::resized()
{
    btnplay->setBounds (16, 264, 48, 24);
    videoVLC->setBounds (16, 16, 312, 240);
    btnstop->setBounds (72, 264, 48, 24);
    btnpause->setBounds (128, 264, 48, 24);
    btnload->setBounds (248, 264, 80, 24);
    //[UserResized] Add your own custom resize handling here..
    //[/UserResized]
}

void MainComponent::buttonClicked (Button* buttonThatWasClicked)
{
    //[UserbuttonClicked_Pre]
    //[/UserbuttonClicked_Pre]

    if (buttonThatWasClicked == btnplay)
    {
        //[UserButtonCode_btnplay] -- add your button handler code here..
        videoVLC->play();
        //[/UserButtonCode_btnplay]
    }
    else if (buttonThatWasClicked == btnstop)
    {
        //[UserButtonCode_btnstop] -- add your button handler code here..
        videoVLC->stop();
        //[/UserButtonCode_btnstop]
    }
    else if (buttonThatWasClicked == btnpause)
    {
        //[UserButtonCode_btnpause] -- add your button handler code here..
        videoVLC->pause();
        //[/UserButtonCode_btnpause]
    }
    else if (buttonThatWasClicked == btnload)
    {
        //[UserButtonCode_btnload] -- add your button handler code here..
       FileChooser fc (T("Seleccione el archivo de video o audio.."),
                        File::getCurrentWorkingDirectory(),
                        T("*.*"),false);
        if (fc.browseForFileToOpen()) {
                       File selectFile = fc.getResult();
                       videoVLC->loadMedia(selectFile.getFullPathName());
        }
        //[/UserButtonCode_btnload]
    }

    //[UserbuttonClicked_Post]
    //[/UserbuttonClicked_Post]
}

Send my project to your mail.
It is for Windows.

Nice job yosvanissc. From a UI perspective, this is exactly what I was trying to achieve. Take a look at the screen shot. You’re a genius, thinking outside the box like that. You took a regular content component, and added the buttons, then added and sized the new VideoVLC object within that component. That VideoVLC object inherits component and then has a DocumentWindow inside of it. Never thought of that, it’s very creative and original. Nice job again. It’s crashing right now when I load the file, but that is probably a Windows vs. Linux difference that I should have resolved soon. Que te vayas bien. Muchas gracias.

[attachment=0]ss1.png[/attachment]

I will prepare it for linux
As soon as you have a time, now I have a lot of workload.

lo preparare para linux
en cuanto tenga un tiempo, ahora tengo mucha carga de trabajo.

Got it working with Linux! Hallelujah!! :stuck_out_tongue: :smiley: :slight_smile: :lol:

Jules, check out this screen shot. Thanks to the help of yosvaniscc, we now have an alternative media player plugin option with Juce, that works on both Windows and Linux. Very nice. I will post this to the sample applications / cookbook site.

[attachment=0]ss2.png[/attachment]

Work in linux very good news, order me to him to my mail or explain here the changes that you made for linux.

funciono en linux! muy buena noticia, mandamelo a mi correo o explica aqui los cambios que hiciste para linux.

mail: yosvaniscc@gmail.com

The only major change was in VideoVLC.cpp, to change the VideoVLC::loadMedia to set the xwindow. I had to comment out a couple of your checks, because it was crashing on loading the file. There are also a couple of compiler warnings on deleting vlc variables that potentially need some looking into.

VideoVLC.cpp

#include "VideoVLC.h"

static void raise(libvlc_exception_t * ex)
{
	if (libvlc_exception_raised (ex))
        {
		AlertWindow::showMessageBox (AlertWindow::InfoIcon,
			T("VCLPlayer"),
			libvlc_exception_get_message(ex));
			fprintf (stderr, "error: %s\n", libvlc_exception_get_message(ex));
             		//exit (-1);
        }
}
VideoVLC::VideoVLC ()
        : Component (T("VideoVLC"))
{    
	setSize (400, 200);
        vlc_visor=new DocumentWindow(T(""),
                              Colours::black,
                              0,
                              true);
        vlc_visor->setAlwaysOnTop(true);
        vlc_visor->setTitleBarHeight(0);
        vlc_visor->setDropShadowEnabled(false);

        libvlc_exception_init (&vlc_except);
        isLoadMedia=false;
}

VideoVLC::~VideoVLC()
{
	delete vlc_instan;
        delete vlc_media;
        delete vlc_mplayer;
        delete vlc_visor;
}

void VideoVLC::paint (Graphics& g)
{
	g.fillAll (Colours::black);
}
void VideoVLC::resized()
{


}
void VideoVLC::timerCallback()
{
	vlc_visor->setBounds(getScreenX(),getScreenY(),getWidth(),getHeight());
}
void VideoVLC::play()
{
	if(isLoadMedia==false){
		return;
	}
        libvlc_media_player_play (vlc_mplayer, &vlc_except);
        raise (&vlc_except);
        startTimer(1);
        vlc_visor->setVisible(true);
}
void VideoVLC::stop()
{
        if(isLoadMedia==false){
		return;
	}
        libvlc_media_player_stop(vlc_mplayer, &vlc_except);
        raise (&vlc_except);
        vlc_visor->setVisible(false);
        stopTimer();
}
void VideoVLC::pause()
{
        if(isLoadMedia==false){
		return;
	}
        libvlc_media_player_pause(vlc_mplayer, &vlc_except);
        raise (&vlc_except);
}
void VideoVLC::setRate(float p_rate)
{
	if(isLoadMedia==false){
		return;
	}
	libvlc_media_player_set_rate(vlc_mplayer,p_rate ,&vlc_except);
	raise (&vlc_except);
}
float VideoVLC::getRate()
{
	if(isLoadMedia==false){
		return -1;
	}
	float vr=libvlc_media_player_get_rate(vlc_mplayer,&vlc_except);
	raise (&vlc_except);
	return vr;
}
void VideoVLC::setPosition(float p_posi)
{
	if(isLoadMedia==false){
		return;
	}
	libvlc_media_player_set_position(vlc_mplayer,p_posi ,&vlc_except);
	raise (&vlc_except);
}
float VideoVLC::getPosition()
{
	if(isLoadMedia==false){
		return -1;
	}
	float vr=libvlc_media_player_get_position(vlc_mplayer,&vlc_except);
	raise (&vlc_except);
	return vr;
}
void VideoVLC::loadMedia(String pmedia)
{
        const char * const vlc_args[] = {
                  "-I", "dummy",
                  "--ignore-config",
                  //"--plugin-path=C:\\plugins\\"
	};

        /*if(vlc_instan !=0){
		delete vlc_instan;
	}*/

        vlc_instan = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args, &vlc_except);
        raise (&vlc_except);

        /*if(vlc_media !=0){
		delete vlc_media;
	}*/

        vlc_media = libvlc_media_new (vlc_instan,pmedia,&vlc_except);
        raise (&vlc_except);
        
	/*if(vlc_mplayer !=0){
            stop();
            delete vlc_mplayer;
	}*/

        vlc_mplayer = libvlc_media_player_new_from_media (vlc_media, &vlc_except);
        raise (&vlc_except);
        libvlc_media_release (vlc_media);

        libvlc_media_player_set_xwindow(vlc_mplayer,(uint32_t)vlc_visor->getWindowHandle(),&vlc_except);
        raise (&vlc_except);
        isLoadMedia=true;
}

Cool stuff, well done chaps!

But what on earth is that video frame supposed to be??

It’s a lion playing with toys at the MGM Grand in Las Vegas. Shot as a QuickTime *.mov with an iPhone, the video frame is rotated 90 degrees.

This part of code is necessary to avoid two reproductions at the same time.

español: esta parte de código es necesaria para evitar dos reproducciones al mismo tiempo.

 if(vlc_mplayer !=0){
       stop();
    //    delete vlc_mplayer;
    }

LoadMedia lists now for Windows and Linux
español: loadMedia lista ahora para Windows y Linux

void VideoVLC::loadMedia(String pmedia)
{


    const char * const vlc_args[] =
    {
        "-I", "dummy",
        "--ignore-config",
        "--plugin-path=C:\\plugins\\"
    };

    // if(vlc_instan !=0){delete vlc_instan;}
    vlc_instan = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args, &vlc_except);
    raise (&vlc_except);

    // if(vlc_media !=0){delete vlc_media;}
    vlc_media = libvlc_media_new (vlc_instan,pmedia,&vlc_except);
    raise (&vlc_except);

    if (vlc_mplayer !=0)
    {
        stop();
        //    delete vlc_mplayer;
    }
    vlc_mplayer = libvlc_media_player_new_from_media (vlc_media, &vlc_except);
    raise (&vlc_except);
    libvlc_media_release (vlc_media);

    SystemStats system;
    if (system.getOperatingSystemName()==T("Linux"))
    {
        libvlc_media_player_set_xwindow(vlc_mplayer,(uint32_t)vlc_visor->getWindowHandle(),&vlc_except);
    }else{
        libvlc_media_player_set_hwnd(vlc_mplayer,vlc_visor->getWindowHandle(),&vlc_except);
    }
    raise (&vlc_except);
    isLoadMedia=true;
}

Thanks.

Implemented volume control

español: control del volumen implementado

Adding to VideoVLC.h

public:
    //==============================================================================
    VideoVLC ();
    ~VideoVLC();

    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
    void play();
    void stop();
    void pause();
    void setPosition(float p_posi);
    float getPosition();
    void setRate(float p_rate);
    float getRate();
    void setVolume(int p_vol);
    int getVolume();

Adding to VideoVLC.cpp

void VideoVLC::setVolume(int p_vol){
     if (isLoadMedia==false)
    {
        return;
    }
    libvlc_audio_set_volume(vlc_instan,p_vol,&vlc_except);
    raise (&vlc_except);
    }
int VideoVLC::getVolume(){
    if (isLoadMedia==false)
    {
        return -1;
    }
    int vr=libvlc_audio_get_volume(vlc_instan,&vlc_except);
    raise (&vlc_except);
    return vr;
}

New changes in the component VideoVLC.

replace DocumenWindows for Component
VideoVLC.h

/***************************************************************************
 * Nombre:      VideoVLC.h
 * Propósito:   Componente JUCE para LibVLC .
 * Autores:  Foro Juce     
 * Creado:      2010-03-28
 * Actualizado: 2010-04-02
 * Licencia:    GNU General Public License.
 ***************************************************************************/
#ifndef __JUCER_HEADER_VIDEOVLC__
#define __JUCER_HEADER_VIDEOVLC__
//[Headers]    
#include <vlc/vlc.h>
#include "juce.h"
//[/Headers]
class VideoVLC  : public Component,
                  private Timer
                  {
public:
    //==============================================================================
    VideoVLC ();
    ~VideoVLC();

    //==============================================================================
    enum{
    STATE_IDLE_CLOSE,
    STATE_OPENING,
    STATE_BUFFERING,
    STATE_PLAYING,
    STATE_PAUSED,
    STATE_STOPPING,
    STATE_ENDED,
    STATE_ERROR,
    };
    //[UserMethods]     -- You can add your own custom methods in this section.
    void play();
    void stop();
    void pause();
    void setPosition(float p_posi);
    float getPosition();
    void setRate(float p_rate);
    float getRate();
    void setVolume(int p_vol);
    int getVolume();
    void loadMedia(String media);
    bool isLoadMedia;
    int getState();
    float getDuration();
    //[/UserMethods]

    void paint (Graphics& g);
    void resized();


    //==============================================================================
    juce_UseDebuggingNewOperator

private:
    //[UserVariables]   -- You can add your own custom variables in this section.
    void timerCallback();
    Component *vlc_visor;
    libvlc_exception_t vlc_except;
    libvlc_instance_t *vlc_instan;
    libvlc_media_player_t *vlc_mplayer;
    libvlc_media_t *vlc_media;
    //[/UserVariables]
    //==============================================================================

    //==============================================================================
    // (prevent copy constructor and operator= being generated..)
    VideoVLC (const VideoVLC&);
    const VideoVLC& operator= (const VideoVLC&);
};


#endif   // __JUCER_HEADER_VIDEOVLC__

VideoVLC.cpp

/***************************************************************************
 * Nombre:      VideoVLC.cpp
 * Propósito:   Componente JUCE para LibVLC .
 * Autor:       Foro Juce.
 * Creado:      2010-03-28
 * Actualizado: 2010-04-02
 * Licencia:    GNU General Public License.
 ***************************************************************************/
#include "VideoVLC.h"

static void raise(libvlc_exception_t * ex)
{
    if (libvlc_exception_raised (ex))
    {
        AlertWindow::showMessageBox (AlertWindow::InfoIcon,
                                     T("VCLPlayer"),
                                     libvlc_exception_get_message(ex));
        fprintf (stderr, "error: %s\n", libvlc_exception_get_message(ex));
        //exit (-1);
    }
}
VideoVLC::VideoVLC ()
        : Component (T("VideoVLC"))
{
    setSize (400, 200);
    vlc_visor=new Component("VisorVLC");
    vlc_visor->setOpaque(true);
    vlc_visor->addToDesktop(ComponentPeer::windowIsTemporary);
    //toBehind (vlc_visor);
    libvlc_exception_init (&vlc_except);
    isLoadMedia=false;
}
VideoVLC::~VideoVLC(){
    delete vlc_instan;
    delete vlc_media;
    delete vlc_mplayer;
    delete vlc_visor;
}
void VideoVLC::paint (Graphics& g){
     g.fillAll (Colours::black);
}
void VideoVLC::resized(){

}
void VideoVLC::timerCallback(){
    vlc_visor->setBounds(getScreenX(),getScreenY(),getWidth(),getHeight());
    if(getState()==STATE_ENDED){
         stopTimer();
         vlc_visor->setVisible(false);
    }
    vlc_visor->toFront(false);
}
void VideoVLC::play(){
    if (isLoadMedia==false)
    {
        return;
    }
    libvlc_media_player_play (vlc_mplayer, &vlc_except);
    raise (&vlc_except);
    startTimer(1);
    vlc_visor->setVisible(true);
}
void VideoVLC::stop(){
    if (isLoadMedia==false)
    {
        return;
    }
    libvlc_media_player_stop(vlc_mplayer, &vlc_except);
    raise (&vlc_except);
    vlc_visor->setVisible(false);
    stopTimer();
}
void VideoVLC::pause(){
    if (isLoadMedia==false)
    {
        return;
    }
    libvlc_media_player_pause(vlc_mplayer, &vlc_except);
    raise (&vlc_except);
}
void VideoVLC::setRate(float p_rate){
    if (isLoadMedia==false)
    {
        return;
    }
    libvlc_media_player_set_rate(vlc_mplayer,p_rate ,&vlc_except);
    raise (&vlc_except);
}
float VideoVLC::getRate(){
    if (isLoadMedia==false)
    {
        return -1;
    }
    float vr=libvlc_media_player_get_rate(vlc_mplayer,&vlc_except);
    raise (&vlc_except);
    return vr;
}
void VideoVLC::setPosition(float p_posi){
    if (isLoadMedia==false)
    {
        return;
    }
    libvlc_media_player_set_position(vlc_mplayer,p_posi ,&vlc_except);
    raise (&vlc_except);
}
float VideoVLC::getPosition(){
    if (isLoadMedia==false)
    {
        return -1;
    }
    float vr=libvlc_media_player_get_position(vlc_mplayer,&vlc_except);
    //raise (&vlc_except);
    return vr;
}
void VideoVLC::loadMedia(String pmedia){

    const char * const vlc_args[] =
    {
        "-I", "dummy",
        "--ignore-config",
        "--plugin-path=C:\\plugins\\"
    };

    vlc_instan = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args, &vlc_except);
    raise (&vlc_except);

    vlc_media = libvlc_media_new (vlc_instan,pmedia,&vlc_except);
    raise (&vlc_except);

    if (vlc_mplayer !=0)
    {
        stop();
    }
    vlc_mplayer = libvlc_media_player_new_from_media (vlc_media, &vlc_except);
    raise (&vlc_except);
    libvlc_media_release (vlc_media);

    SystemStats system;
    if (system.getOperatingSystemName()==T("Linux"))
    {
        libvlc_media_player_set_xwindow(vlc_mplayer,(uint32_t)vlc_visor->getWindowHandle(),&vlc_except);
    }else{
        libvlc_media_player_set_hwnd(vlc_mplayer,vlc_visor->getWindowHandle(),&vlc_except);
    }
    raise (&vlc_except);
    isLoadMedia=true;
}
void VideoVLC::setVolume(int p_vol){
     if (isLoadMedia==false)
    {
        return;
    }
    libvlc_audio_set_volume(vlc_instan,p_vol,&vlc_except);
    raise (&vlc_except);
    }
int VideoVLC::getVolume(){
    if (isLoadMedia==false)
    {
        return -1;
    }
    int vr=libvlc_audio_get_volume(vlc_instan,&vlc_except);
    raise (&vlc_except);
    return vr;
}
int VideoVLC::getState(){
    if (isLoadMedia==false)
    {
        return 0;
    }
    return libvlc_media_get_state(vlc_media,&vlc_except);
}
float VideoVLC::getDuration(){
    if (isLoadMedia==false)
    {
        return 0;
    }
    return libvlc_media_player_get_length(vlc_mplayer,&vlc_except);
}

Isn’t that a little unfair or unethical to be restricting the code as if you are the sole author? After all, I was the one who gave the idea for LibVLC media player plugin, sent you my sample code, studied the vlc source code, and told everyone in this forum the libvlc function for hooking it into a juce window. This implementation would have never been written if it weren’t for my involvement and work on this. Also, there are others who helped with the sample vlc implementation that your VideoVLC object is using, such as this guys’ implementation - http://wiki.videolan.org/LibVLC_SampleCode_Qt:

Beyond the question of fairness, you might want to check with Jules first (or a lawyer) on the legal question - before you post this on the Juce forums with a GPL license. Julian Storer is the author of Juce, and Juce is already under GPL, and usage of Juce in a commercial application requires you to pay his company for a license fee. I thought the spirit of the Juce forums was the open and free sharing of information, unrestricted. A restrictive license like GPL requires any modifications to the code to be posted back on the public Internet. If any license is used, BSD would be preferred. A permissive license like BSD only requires the user to post the copyright notice in the source code. So if you used BSD, you would still always get credit in the source code.

I give you a lot of credit and props for your VideoVLC class implementation. Just don’t think it’s fair to post this out with a restricted license when others were involved. If you had already created your implementation before all of my posts, and helped, that would be a different matter - there would be no disputing your sole authorship.

Apologies, I seat him not himself in which he was thinking.
You are absolutely right; I am going to correct.

Español: disculpas, lo siento no se en que estaba pensando.
tienes toda la razón; voy a corregir .

No worries, and thanks. Just saw this as a team effort together. You did a great job.

You there, like author of the original idea, propose an idea to create the the authorship.