Add twitch url check

This commit is contained in:
Exeldro 2024-07-17 08:50:12 +02:00
parent 754c82e5ee
commit e164453417
No known key found for this signature in database
GPG Key ID: 97269A83FC715751

View File

@ -67,6 +67,7 @@ bool obs_module_load(void)
void obs_module_post_load()
{
if (multistream_dock)
multistream_dock->LoadVerticalOutputs(true);
}
@ -106,9 +107,11 @@ void RemoveWidget(QWidget *widget)
}
// Platform icons deciphered from endpoints
QIcon MultistreamDock::getPlatformFromEndpoint(QString endpoint) {
QIcon MultistreamDock::getPlatformFromEndpoint(QString endpoint)
{
if (endpoint.contains(QString::fromUtf8(".contribute.live-video.net"))) { // twitch
if (endpoint.contains(QString::fromUtf8(".contribute.live-video.net")) ||
endpoint.contains(QString::fromUtf8(".twitch.tv"))) { // twitch
return platformIconTwitch;
} else if (endpoint.contains(QString::fromUtf8(".youtube.com"))) { // youtube
return platformIconYouTube;
@ -118,14 +121,13 @@ QIcon MultistreamDock::getPlatformFromEndpoint(QString endpoint) {
return platformIconTikTok;
} else if (endpoint.contains(QString::fromUtf8(".pscp.tv"))) { // twitter
return platformIconTwitter;
} else if (endpoint.contains(QString::fromUtf8("livepush.trovo.live/live"))) { // trovo
} else if (endpoint.contains(QString::fromUtf8("livepush.trovo.live"))) { // trovo
return platformIconTrovo;
} else if (endpoint.contains(QString::fromUtf8(".facebook.com"))) { // facebook
return platformIconFacebook;
} else { // unknown
return platformIconUnknown;
}
}
// Output button styling
@ -147,7 +149,6 @@ auto outputTitleStyle = QString("QLabel{}"); // "Built -in str
auto outputGroupStyle = QString("background-color: %1; padding: 0px;")
.arg(QPalette().color(QPalette::ColorRole::Mid).name(QColor::HexRgb)); // wrapper around above
// For showing warning for no vertical integration
void showVerticalWarning(QVBoxLayout *verticalLayout)
{
@ -553,7 +554,6 @@ void MultistreamDock::LoadOutput(obs_data_t *data, bool vertical)
auto l2 = new QHBoxLayout;
auto platformIconLabel = new QLabel;
auto platformIcon = getPlatformFromEndpoint(endpoint);