| 31 | } |
| 32 | |
| 33 | void menu::PlayerYoutube::Load() |
| 34 | { |
| 35 | FTItem *ftItem = NULL; |
| 36 | void *ftCtx = NULL; |
| 37 | int32_t ret = 0; |
| 38 | string text8; |
| 39 | wstring text16; |
| 40 | |
| 41 | m_videoLink = ""; |
| 42 | m_videoLinkForDw = ""; |
| 43 | m_audioLink.clear(); |
| 44 | if (m_option) |
| 45 | { |
| 46 | delete m_option; |
| 47 | m_option = NULL; |
| 48 | } |
| 49 | |
| 50 | sce::AppSettings *settings = menu::Settings::GetAppSetInstance(); |
| 51 | |
| 52 | int32_t vodVideoQuality; |
| 53 | settings->GetInt("yt_quality_vod_video", reinterpret_cast<int32_t *>(&vodVideoQuality), 3); |
| 54 | |
| 55 | SCE_DBG_LOG_INFO("[Load] Video id: %s", m_videoId.c_str()); |
| 56 | |
| 57 | ret = ftParseVideo(&ftCtx, m_videoId.c_str(), vodVideoQuality, FT_AUDIO_VOD_QUALITY_MEDIUM, &ftItem); |
| 58 | if (ret == FT_OK) |
| 59 | { |
| 60 | if (ftItem->videoItem->id) |
| 61 | { |
| 62 | m_description = ftItem->videoItem->description; |
| 63 | |
| 64 | thread::RMutex::MainThreadMutex()->Lock(); |
| 65 | |
| 66 | OnDescButton(); |
| 67 | |
| 68 | text8 = ftItem->videoItem->title; |
| 69 | common::Utf8ToUtf16(text8, &text16); |
| 70 | m_title->SetString(text16); |
| 71 | |
| 72 | text8 = "Uploaded by "; |
| 73 | text8 += ftItem->videoItem->author; |
| 74 | common::Utf8ToUtf16(text8, &text16); |
| 75 | m_stat0->SetString(text16); |
| 76 | |
| 77 | ytutils::FormatViews(text16, ftItem->videoItem->viewCount); |
| 78 | m_stat1->SetString(text16); |
| 79 | |
| 80 | // TODO: do something with m_stat2? |
| 81 | // text8 = "ERASE ME"; |
| 82 | // common::Utf8ToUtf16(text8, &text16); |
| 83 | // m_stat2->SetString(text16); |
| 84 | |
| 85 | thread::RMutex::MainThreadMutex()->Unlock(); |
| 86 | |
| 87 | if (ftItem->videoItem->isLive) |
| 88 | { |
| 89 | SCE_DBG_LOG_INFO("[Load] Video is LIVE"); |
| 90 | |