关闭MediaPlayer的播放器复用功能

This commit is contained in:
xiongziliang 2018-12-10 15:37:55 +08:00
parent dd7c7375f4
commit 91d8888784
2 changed files with 2 additions and 8 deletions

View File

@ -38,14 +38,10 @@ MediaPlayer::MediaPlayer() {
MediaPlayer::~MediaPlayer() { MediaPlayer::~MediaPlayer() {
} }
void MediaPlayer::play(const char* strUrl) { void MediaPlayer::play(const char* strUrl) {
string strPrefix = FindField(strUrl, NULL, "://");
if ((strcasecmp(_strPrefix.data(),strPrefix.data()) != 0) || strPrefix.empty()) {
//协议切换
_strPrefix = strPrefix;
_parser = PlayerBase::createPlayer(strUrl); _parser = PlayerBase::createPlayer(strUrl);
}
_parser->setOnShutdown(_shutdownCB); _parser->setOnShutdown(_shutdownCB);
_parser->setOnPlayResult(_playResultCB); _parser->setOnPlayResult(_playResultCB);
_parser->setMediaSouce(_pMediaSrc);
_parser->mINI::operator=(*this); _parser->mINI::operator=(*this);
_parser->play(strUrl); _parser->play(strUrl);
} }

View File

@ -47,8 +47,6 @@ public:
void pause(bool bPause) override; void pause(bool bPause) override;
void teardown() override; void teardown() override;
TaskExecutor::Ptr getExecutor(); TaskExecutor::Ptr getExecutor();
private:
string _strPrefix;
}; };