0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
obs-studio/UI/auth-youtube.hpp
derrod 18f40be820 UI: Add YouTube Chat Dock
Since embedded browsers are no longer allowed to log into Google from the chat
dock is effectively read-only.
To prevent users from even trying to log in the input field is hidden
via custom CSS.
2021-08-23 18:28:23 -07:00

47 lines
998 B
C++

#pragma once
#include <QObject>
#include <QString>
#include <random>
#include <string>
#include "auth-oauth.hpp"
#ifdef BROWSER_AVAILABLE
class BrowserDock;
#endif
inline const std::vector<Auth::Def> youtubeServices = {
{"YouTube - RTMP", Auth::Type::OAuth_LinkedAccount, true},
{"YouTube - RTMPS", Auth::Type::OAuth_LinkedAccount, true},
{"YouTube - HLS", Auth::Type::OAuth_LinkedAccount, true}};
class YoutubeAuth : public OAuthStreamKey {
Q_OBJECT
bool uiLoaded = false;
std::mt19937 randomSeed;
std::string section;
#ifdef BROWSER_AVAILABLE
QSharedPointer<BrowserDock> chat;
QSharedPointer<QAction> chatMenu;
#endif
virtual bool RetryLogin() override;
virtual void SaveInternal() override;
virtual bool LoadInternal() override;
virtual void LoadUI() override;
QString GenerateState();
public:
YoutubeAuth(const Def &d);
void SetChatId(QString &chat_id);
void ResetChat();
static std::shared_ptr<Auth> Login(QWidget *parent,
const std::string &service);
};