diff --git a/src/Player/MediaPlayer.cpp b/src/Player/MediaPlayer.cpp index 11f8a3ab..e208fc52 100644 --- a/src/Player/MediaPlayer.cpp +++ b/src/Player/MediaPlayer.cpp @@ -38,14 +38,10 @@ MediaPlayer::MediaPlayer() { MediaPlayer::~MediaPlayer() { } 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->setOnPlayResult(_playResultCB); + _parser->setMediaSouce(_pMediaSrc); _parser->mINI::operator=(*this); _parser->play(strUrl); } diff --git a/src/Player/MediaPlayer.h b/src/Player/MediaPlayer.h index b2e047cc..7e60e126 100644 --- a/src/Player/MediaPlayer.h +++ b/src/Player/MediaPlayer.h @@ -47,8 +47,6 @@ public: void pause(bool bPause) override; void teardown() override; TaskExecutor::Ptr getExecutor(); -private: - string _strPrefix; };