From 6758cdc82e4cb295123b0a84819c6a6ebd5ebad0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 15 Jul 2022 12:48:38 +0200 Subject: Youtube: do not autoplay next if starting qm with youtube url, opening youtube url in info page or matrix --- plugins/Page.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/Page.hpp') 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 &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 { -- cgit v1.2.3