diff options
Diffstat (limited to 'plugins/Page.hpp')
-rw-r--r-- | plugins/Page.hpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/plugins/Page.hpp b/plugins/Page.hpp index 54d7d88..0c5b093 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -102,18 +102,30 @@ namespace QuickMedia { class VideoPage : public Page { public: - VideoPage(Program *program) : Page(program) {} + VideoPage(Program *program, std::string url) : Page(program), url(std::move(url)) {} virtual PageTypez get_type() const override { return PageTypez::VIDEO; } virtual bool autoplay_next_item() { return false; } virtual BodyItems get_related_media(const std::string &url, std::string &channel_url) { (void)url; (void)channel_url; return {}; } virtual std::unique_ptr<Page> create_search_page(Program *program, int &search_delay) { (void)program; (void)search_delay; return nullptr; } virtual std::unique_ptr<Page> create_comments_page(Program *program) { (void)program; return nullptr; } // Return nullptr if the service doesn't support related videos page - virtual std::unique_ptr<RelatedVideosPage> create_related_videos_page(Program *program, const std::string &video_url, const std::string &video_title) = 0; + virtual std::unique_ptr<RelatedVideosPage> create_related_videos_page(Program *program) = 0; // Return nullptr if the service doesn't support channels page virtual std::unique_ptr<Page> create_channels_page(Program *program, const std::string &channel_url) = 0; - virtual std::string get_url() = 0; + void set_url(std::string new_url) { url = std::move(new_url); } + std::string get_url() { return url; } + // Falls back to |get_url| if this and |get_audio_url| returns empty strings + virtual std::string get_video_url(int max_height, bool &has_embedded_audio) { + (void)max_height; + has_embedded_audio = true; + return ""; + } + // Only used if |get_video_url| sets |has_embedded_audio| to false + virtual std::string get_audio_url() { return ""; } virtual std::string url_get_playable_url(const std::string &url) { return url; } virtual bool video_should_be_skipped(const std::string &url) { (void)url; return false; } + virtual PluginResult load() { return PluginResult::OK; } + protected: + std::string url; }; }
\ No newline at end of file |