From 49cfbb60c092f909405e652decbc41ede1267d08 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 30 May 2013 10:02:14 +0400 Subject: [PATCH] gui/movieplayer.cpp: add youtube feeds play mode --- src/gui/movieplayer.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index c77117577..1dbca888f 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -188,6 +188,11 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) timeshift = 0; if (actionKey == "tsmoviebrowser") { isMovieBrowser = true; + moviebrowser->setMode(MB_SHOW_RECORDS); + } + else if (actionKey == "ytplayback") { + isMovieBrowser = true; + moviebrowser->setMode(MB_SHOW_YT); } else if (actionKey == "fileplayback") { } @@ -343,15 +348,17 @@ bool CMoviePlayerGui::SelectFile() Path_local = moviebrowser->getCurrentDir(); CFile *file; if ((file = moviebrowser->getSelectedFile()) != NULL) { - full_name = file->Name.c_str(); - // get the movie info handle (to be used for e.g. bookmark handling) p_movie_info = moviebrowser->getCurrentMovieInfo(); -#if 0 - bool recfile = CRecordManager::getInstance()->RecordingStatus(p_movie_info->epgId) && - CRecordManager::getInstance()->GetFileName(p_movie_info->epgId) == file->Name; -#endif + if (moviebrowser->getMode() == MB_SHOW_RECORDS) { + full_name = file->Name; + } + else if (moviebrowser->getMode() == MB_SHOW_YT) { + full_name = file->Url; + is_file_player = true; + } fillPids(); + // get the start position for the movie startposition = 1000 * moviebrowser->getCurrentStartPos(); printf("CMoviePlayerGui::SelectFile: file %s start %d apid %X atype %d vpid %x vtype %d\n", full_name.c_str(), startposition, currentapid, currentac3, vpid, vtype); @@ -903,7 +910,7 @@ void CMoviePlayerGui::selectAudioPid(bool file_player) APIDSelector.addItem(item, defpid); } - if (p_movie_info) { + if (p_movie_info && numpida <= p_movie_info->audioPids.size()) { APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); CVolume::getInstance()->SetCurrentChannel(p_movie_info->epgId);