1
0

YoutubeAuth.hpp 935 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "OAuth.hpp"
  3. inline const std::vector<Auth::Def> youtubeServices = {{"YouTube - RTMP", Auth::Type::OAuth_LinkedAccount, true, true},
  4. {"YouTube - RTMPS", Auth::Type::OAuth_LinkedAccount, true, true},
  5. {"YouTube - HLS", Auth::Type::OAuth_LinkedAccount, true, true}};
  6. #ifdef BROWSER_AVAILABLE
  7. class YoutubeChatDock;
  8. #endif
  9. class YoutubeAuth : public OAuthStreamKey {
  10. Q_OBJECT
  11. bool uiLoaded = false;
  12. std::string section;
  13. #ifdef BROWSER_AVAILABLE
  14. YoutubeChatDock *chat = nullptr;
  15. #endif
  16. virtual bool RetryLogin() override;
  17. virtual void SaveInternal() override;
  18. virtual bool LoadInternal() override;
  19. virtual void LoadUI() override;
  20. QString GenerateState();
  21. public:
  22. YoutubeAuth(const Def &d);
  23. ~YoutubeAuth();
  24. void SetChatId(const QString &chat_id);
  25. void ResetChat();
  26. void ReloadChat();
  27. static std::shared_ptr<Auth> Login(QWidget *parent, const std::string &service);
  28. };