Skip to content

Commit 6ce46b5

Browse files
author
James Brundage
committed
Add-OBSMediaSource, adding -FitToScreen
1 parent 52a768d commit 6ce46b5

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

Commands/Sources/Add-OBSMediaSource.ps.ps1

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ function Add-OBSMediaSource
7474
# If not set, you will get an error if a source with the same name exists.
7575
[Parameter(ValueFromPipelineByPropertyName)]
7676
[switch]
77-
$Force
77+
$Force,
78+
79+
# If set, will fit the input to the screen.
80+
[Parameter(ValueFromPipelineByPropertyName)]
81+
[switch]
82+
$FitToScreen
7883
)
7984

8085
process {
@@ -155,7 +160,13 @@ function Add-OBSMediaSource
155160
$outputAddedResult = Add-OBSInput @addSplat
156161
if ($outputAddedResult) {
157162
Get-OBSSceneItem -sceneName $myParameters["Scene"] |
158-
Where-Object SourceName -eq $name
163+
Where-Object SourceName -eq $name |
164+
Foreach-Object {
165+
if ($FitToScreen) {
166+
$_.FitToScreen()
167+
}
168+
$_
169+
}
159170
}
160171
}
161172
}

0 commit comments

Comments
 (0)