diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-07-15 12:48:38 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-07-15 12:48:38 +0200 |
commit | 6758cdc82e4cb295123b0a84819c6a6ebd5ebad0 (patch) | |
tree | 86ed3a0db9134d72937c813ab037688e581766c4 /plugins | |
parent | 0bf55deae8d8a681b32a1fa91908ed1f566dbbf5 (diff) |
Youtube: do not autoplay next if starting qm with youtube url, opening youtube url in info page or matrix
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; |