]> git.sesse.net Git - vlc/blob - mozilla/vlcpeer.cpp
* ./mozilla/*: added hooks so that the vlc plugin is scriptable from
[vlc] / mozilla / vlcpeer.cpp
1 /*****************************************************************************
2  * vlcpeer.cpp: a VideoLAN Client plugin for Mozilla
3  *****************************************************************************
4  * Copyright (C) 2002 VideoLAN
5  * $Id: vlcpeer.cpp,v 1.1 2002/09/17 08:18:24 sam Exp $
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <vlc/vlc.h>
28
29 #include "npapi.h"
30 #include "vlcpeer.h"
31 #include "vlcplugin.h"
32
33 #include "nsMemory.h"
34
35
36 NS_IMPL_ISUPPORTS2( VlcPeer, VlcIntf, nsIClassInfo )
37
38 VlcPeer::VlcPeer()
39 {
40     NS_INIT_ISUPPORTS();
41 }
42
43 VlcPeer::VlcPeer( VlcPlugin * plugin )
44 {
45     NS_INIT_ISUPPORTS();
46     p_plugin = plugin;
47 }
48
49 VlcPeer::~VlcPeer()
50 {
51     ;
52 }
53
54 NS_IMETHODIMP VlcPeer::Play()
55 {
56     if( p_plugin )
57     {
58         p_plugin->Play();
59     }
60     return NS_OK;
61 }
62
63 NS_IMETHODIMP VlcPeer::Pause()
64 {
65     if( p_plugin )
66     {
67         p_plugin->Pause();
68     }
69     return NS_OK;
70 }
71
72 NS_IMETHODIMP VlcPeer::Stop()
73 {
74     if( p_plugin )
75     {
76         p_plugin->Stop();
77     }
78     return NS_OK;
79 }
80