Skip to content

Commit 0191579

Browse files
author
James Brundage
committed
Adding Show-OBS (Fixes #66)
1 parent ca9cae7 commit 0191579

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Commands/Show-OBS.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@ function Show-OBS {
105105
$SourceParameter.Force = $Force
106106
}
107107

108+
# If we do not want to create a media source,
108109
if (-not $IsMediaSource) {
109-
# Create a browser source
110+
# we create a browser source.
110111
$SourceParameter.Uri = $FilePath
112+
# If the path was not already HTML,
111113
if ($RootPath -and $FilePath -notmatch '\.html{0,1}$') {
112-
# Make a minimal frame in a .html file
114+
# we make a minimal frame in a .html file
113115
$relativePath = $FilePath.Substring($RootPath.Length + 1)
114116
$htmlFrame = "<html>
115117
<body style='width:100%;height:100%'>
@@ -121,7 +123,8 @@ function Show-OBS {
121123
$htmlPath = Join-Path $RootPath "$($leafPath).html"
122124

123125
$htmlFrame | Set-Content -Path $htmlPath
124-
# And set up the CSS for that frame.
126+
# And set up the CSS for that frame, passing down -Opacity.
127+
# (this may not work for all images)
125128
$css = "
126129
body {
127130
background-color: rgba(0, 0, 0, 0); margin: 0px auto; overflow: hidden;
@@ -134,7 +137,7 @@ function Show-OBS {
134137
"
135138
$SourceParameter.Uri = $htmlPath
136139
$SourceParameter.CSS = $css
137-
Add-OBSBrowserSource @SourceParameter
140+
Add-OBSBrowserSource @SourceParameter
138141
} else {
139142
Add-OBSBrowserSource @SourceParameter
140143
}

0 commit comments

Comments
 (0)