Merge pull request #1973 from restreamio/master

UI: Add Restream integration: stream info widget, channels widget
This commit is contained in:
Jim 2019-07-22 01:33:59 -07:00 committed by GitHub
commit c36a86bb46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 3 deletions

View File

@ -172,19 +172,40 @@ void RestreamAuth::LoadUI()
browser = cef->create_widget(nullptr, url, panel_cookies);
info->setWidget(browser);
main->addDockWidget(Qt::RightDockWidgetArea, info.data());
main->addDockWidget(Qt::LeftDockWidgetArea, info.data());
infoMenu.reset(main->AddDockWidget(info.data()));
/* ----------------------------------- */
url = "https://restream.io/channel/embed";
channels.reset(new RestreamWidget());
channels->setObjectName("restreamChannel");
channels->resize(410, 600);
channels->setMinimumSize(410, 300);
channels->setWindowTitle(QTStr("RestreamAuth.Channels"));
channels->setAllowedAreas(Qt::AllDockWidgetAreas);
browser = cef->create_widget(nullptr, url, panel_cookies);
channels->setWidget(browser);
main->addDockWidget(Qt::LeftDockWidgetArea, channels.data());
channelMenu.reset(main->AddDockWidget(channels.data()));
/* ----------------------------------- */
chat->setFloating(true);
info->setFloating(true);
chat->move(pos.x() + size.width() - chat->width() - 50, pos.y() + 50);
info->move(pos.x() + 40, pos.y() + 50);
channels->setFloating(true);
chat->move(pos.x() + size.width() - chat->width() - 30, pos.y() + 60);
info->move(pos.x() + 20, pos.y() + 60);
channels->move(pos.x() + 20 + info->width() + 10, pos.y() + 60);
if (firstLoad) {
chat->setVisible(true);
info->setVisible(true);
channels->setVisible(true);
} else {
const char *dockStateStr = config_get_string(
main->Config(), service(), "DockState");

View File

@ -9,8 +9,12 @@ class RestreamAuth : public OAuthStreamKey {
QSharedPointer<RestreamWidget> chat;
QSharedPointer<RestreamWidget> info;
QSharedPointer<RestreamWidget> channels;
QSharedPointer<QAction> chatMenu;
QSharedPointer<QAction> infoMenu;
QSharedPointer<QAction> channelMenu;
bool uiLoaded = false;
virtual bool RetryLogin() override;

View File

@ -115,6 +115,7 @@ TwitchAuth.Stats="Twitch Stats"
TwitchAuth.Feed="Twitch Activity Feed"
TwitchAuth.TwoFactorFail.Title="Could not query stream key"
TwitchAuth.TwoFactorFail.Text="OBS was unable to connect to your Twitch account. Please make sure two-factor authentication is set up in your <a href='https://www.twitch.tv/settings/security'>Twitch security settings</a> as this is required to stream."
RestreamAuth.Channels="Restream Channels"
# copy filters
Copy.Filters="Copy Filters"

View File

@ -218,6 +218,9 @@ void AutoConfigTestPage::TestBandwidthThread()
wiz->serviceName == "Restream.io - RTMP") {
string_depad_key(key);
key += "?test=true";
} else if (wiz->serviceName == "Restream.io - FTL") {
string_depad_key(key);
key += "?test";
}
obs_data_set_string(service_settings, "service",

View File

@ -575,6 +575,13 @@ void AutoConfigStreamPage::UpdateKeyLink()
text += "</a>";
isYoutube = true;
} else if (serviceName.startsWith("Restream.io")) {
text += " <a href=\"https://";
text += "restream.io/settings/streaming-setup?from=OBS";
text += "\">";
text += QTStr(
"Basic.AutoConfig.StreamPage.StreamKey.LinkToSite");
text += "</a>";
}
if (isYoutube) {

View File

@ -198,6 +198,13 @@ void OBSBasicSettings::UpdateKeyLink()
text += QTStr(
"Basic.AutoConfig.StreamPage.StreamKey.LinkToSite");
text += "</a>";
} else if (serviceName.startsWith("Restream.io")) {
text += " <a href=\"https://";
text += "restream.io/settings/streaming-setup?from=OBS";
text += "\">";
text += QTStr(
"Basic.AutoConfig.StreamPage.StreamKey.LinkToSite");
text += "</a>";
}
ui->streamKeyLabel->setText(text);