diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Page.hpp | 4 | ||||
-rw-r--r-- | plugins/Youtube.hpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/Page.hpp b/plugins/Page.hpp index c1ca012..6ac0450 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -136,9 +136,10 @@ namespace QuickMedia { class VideoPage : public Page { public: - VideoPage(Program *program, std::string url) : Page(program), url(std::move(url)) {} + VideoPage(Program *program, std::string url, bool autoplay = true) : Page(program), url(std::move(url)), autoplay(autoplay) {} virtual PageTypez get_type() const override { return PageTypez::VIDEO; } virtual bool autoplay_next_item() { return false; } + bool should_autoplay() const { return autoplay; } virtual BodyItems get_related_media(const std::string &url) { (void)url; return {}; } virtual PluginResult get_related_pages(const BodyItems &related_videos, const std::string &channel_url, std::vector<Tab> &result_tabs) { (void)related_videos; @@ -181,6 +182,7 @@ namespace QuickMedia { virtual void set_watch_progress(int64_t time_pos_sec, int64_t duration_sec) { (void)time_pos_sec; (void)duration_sec; } protected: std::string url; + bool autoplay; }; class BookmarksPage : public LazyFetchPage { diff --git a/plugins/Youtube.hpp b/plugins/Youtube.hpp index 5affe04..cea5d8d 100644 --- a/plugins/Youtube.hpp +++ b/plugins/Youtube.hpp @@ -142,7 +142,7 @@ namespace QuickMedia { class YoutubeVideoPage : public VideoPage { public: - YoutubeVideoPage(Program *program, std::string url); + YoutubeVideoPage(Program *program, std::string url, bool autoplay = true); const char* get_title() const override { return ""; } BodyItems get_related_media(const std::string &url) override; PluginResult get_related_pages(const BodyItems &related_videos, const std::string &channel_url, std::vector<Tab> &result_tabs) override; |