Skip to content

Commit 8782c48

Browse files
author
James Brundage
committed
Add-OBSBrowserSource: Fixing Local Files (#34)
1 parent 826f9d0 commit 8782c48

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Commands/Sources/Add-OBSBrowserSource.ps.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,20 @@ function Add-OBSBrowserSource
112112
}
113113
}
114114

115-
if ($fps -ne 30) {
115+
if ($fps -and $fps -ne 30) {
116116
$myParameterData["custom_fps"] = $true
117117
}
118-
119118
if ($uri.Scheme -eq 'File') {
120119
if (Test-Path $uri.AbsolutePath) {
121-
$myParameterData["local_file"] = "$uri" -replace '[\\/]', '/'
120+
$myParameterData["local_file"] = "$uri" -replace '[\\/]', '/' -replace '^file:///'
122121
$myParameterData["is_local_file"] = $true
123122
}
124123
}
125124
else
126125
{
127126
if (Test-Path $uri) {
128127
$rp = $ExecutionContext.SessionState.Path.GetResolvedPSPathFromPSPath($uri)
129-
$myParameterData["local_file"] = "$rp" -replace '[\\/]', '/'
128+
$myParameterData["local_file"] = "$rp" -replace '[\\/]', '/' -replace '^file:///'
130129
$myParameterData["is_local_file"] = $true
131130
} else {
132131
$myParameterData["url"] = "$uri"

0 commit comments

Comments
 (0)