/
MediaPlayerMac.cpp
92 lines (75 loc) · 1.65 KB
/
MediaPlayerMac.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**********************************************************\
Original Author: Georg Fritzsche
Created: September 20, 2010
License: Dual license model; choose one of two:
New BSD License
http://www.opensource.org/licenses/bsd-license.php
- or -
GNU Lesser General Public License, version 2.1
http://www.gnu.org/licenses/lgpl-2.1.html
Copyright 2010 Georg Fritzsche,
Firebreath development team
\**********************************************************/
#include <list>
#include <boost/assign/list_of.hpp>
#include "JSAPI.h"
#include "Mac/PluginWindowMacCocoaCA.h"
#include "../MediaPlayer.h"
struct PlayerContext
{
std::string error;
PlayerContext() {}
};
namespace
{
PlayerContextPtr make_context()
{
PlayerContextPtr context(new PlayerContext);
return context;
}
}
MediaPlayer::MediaPlayer()
: m_context()
, m_version("")
, m_type("Mac")
{
try
{
m_context = make_context();
}
catch(const InitializationException& e)
{
m_context = PlayerContextPtr(new PlayerContext);
m_context->error = e.what();
throw;
}
}
MediaPlayer::~MediaPlayer()
{
stop();
}
void MediaPlayer::setWindow(FB::PluginWindow* pluginWindow)
{
if(pluginWindow) {
}
}
const std::string& MediaPlayer::version() const
{
return m_version;
}
const std::string& MediaPlayer::type() const
{
return m_type;
}
const std::string& MediaPlayer::lastError() const
{
return m_context->error;
}
bool MediaPlayer::play(const std::string& file_)
{
return true;
}
bool MediaPlayer::stop()
{
return true;
}