Skip to content

Commit

Permalink
Merge branch 'master' into preview
Browse files Browse the repository at this point in the history
  • Loading branch information
SLOBS-Release committed Mar 15, 2024
2 parents 76e1b7a + 9730f67 commit 10c11a8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,21 @@ export function TikTokEditStreamInfo(p: IPlatformComponentParams<'tiktok'>) {

return (
<Form name="tiktok-settings">
{liveStreamingEnabled && (
<PlatformSettingsLayout
layoutMode={p.layoutMode}
commonFields={
<CommonPlatformFields
key="common"
platform="tiktok"
layoutMode={p.layoutMode}
value={ttSettings}
onChange={updateSettings}
/>
}
requiredFields={<div key={'empty-tiktok'} />}
/>
)}
{legacy && <TikTokEnterCredentialsFormInfo {...p} />}
{!liveStreamingEnabled && <TikTokStreamApplicationInfo />}
<PlatformSettingsLayout
layoutMode={p.layoutMode}
commonFields={
<CommonPlatformFields
key="common"
platform="tiktok"
layoutMode={p.layoutMode}
value={ttSettings}
onChange={updateSettings}
/>
}
requiredFields={<div key={'empty-tiktok'} />}
/>

{(!liveStreamingEnabled || legacy) && <TikTokEnterCredentialsFormInfo {...p} />}
</Form>
);
}
Expand Down Expand Up @@ -101,7 +99,7 @@ export function TikTokEnterCredentialsFormInfo(p: IPlatformComponentParams<'tikt
/>
<InputWrapper
extra={
<>
<div style={{ display: 'flex', flexDirection: 'column' }}>
<Button
onClick={openApplicationInfoPage}
style={{
Expand All @@ -115,7 +113,7 @@ export function TikTokEnterCredentialsFormInfo(p: IPlatformComponentParams<'tikt
<a onClick={() => openInfoPage()}>
{$t('Go live to TikTok with a single click. Click here to learn more.')}
</a>
</>
</div>
}
>
<Button onClick={openProducer} style={{ marginBottom: '10px' }}>
Expand All @@ -135,6 +133,5 @@ function openApplicationInfoPage() {
}

function openProducer() {
const locale = Services.TikTokService.locale;
remote.shell.openExternal(Services.TikTokService.legacyDashboardUrl);
}
9 changes: 5 additions & 4 deletions app/components-react/windows/go-live/useGoLiveSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,12 @@ export class GoLiveSettingsModule {
* Validate the form and show an error message
*/
async validate() {
// TODO: comment authorization error back in after resolving legacy approval flow
// tiktok live authorization error
if (this.state.isEnabled('tiktok') && !Services.TikTokService.liveStreamingEnabled) {
message.error($t('Streaming to TikTok not approved.'));
return false;
}
// if (this.state.isEnabled('tiktok') && !Services.TikTokService.liveStreamingEnabled) {
// message.error($t('Streaming to TikTok not approved.'));
// return false;
// }

if (Services.DualOutputService.views.dualOutputMode && !this.getCanStreamDualOutput()) {
message.error(
Expand Down
23 changes: 21 additions & 2 deletions app/services/scene-collections/nodes/overlays/slots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ interface IItemSchema {

visible?: boolean;
display?: TDisplayType;
locked: boolean;
}

export interface IFolderSchema {
Expand Down Expand Up @@ -122,6 +123,7 @@ export class SlotsNode extends ArrayNode<TSlotSchema, IContext, TSceneNode> {
settings: filter.settings,
};
}),
locked: sceneNode.locked,
};

if (sceneNode.getObsInput().audioMixers) {
Expand Down Expand Up @@ -338,6 +340,8 @@ export class SlotsNode extends ArrayNode<TSlotSchema, IContext, TSceneNode> {
}

this.adjustTransform(sceneItem, obj);
this.setExtraSettings(sceneItem, obj);

if (!existing) {
await obj.content.load({
sceneItem,
Expand All @@ -363,17 +367,32 @@ export class SlotsNode extends ArrayNode<TSlotSchema, IContext, TSceneNode> {
}

adjustTransform(item: SceneItem, obj: IItemSchema) {
// special handling for game capture to show same dimensions on the vertical display as the horizontal
const scaleX = item.type === 'game_capture' ? 1 : obj.scaleX * this.videoService.baseWidth;
const scaleY = item.type === 'game_capture' ? 1 : obj.scaleY * this.videoService.baseHeight;

item.setTransform({
position: {
x: obj.x * this.videoService.baseWidth,
y: obj.y * this.videoService.baseHeight,
},
scale: {
x: obj.scaleX * this.videoService.baseWidth,
y: obj.scaleY * this.videoService.baseHeight,
x: scaleX,
y: scaleY,
},
crop: obj.crop,
rotation: obj.rotation,
});
}

/*
* TODO: this is probably better than doing it individually on every source type
* branch, but might impact performance.
*/
setExtraSettings(item: SceneItem, obj: IItemSchema) {
item.setSettings({
visible: obj.visible ?? true,
locked: obj.locked ?? false,
});
}
}

0 comments on commit 10c11a8

Please sign in to comment.