Use local ip for dash
This commit is contained in:
1 parent
bfe8a3c860
commit
51966cb33f
4 files changed
+14
-15
No files matched your search
@@ -13,8 +13,8 @@ end function
|
||||
|
||||
function OnNodeReady()
|
||||
address = m.webserver@.GetServerAddress(invalid)
|
||||
isValidIp = not StringUtils.IsNullOrEmpty(address)
|
||||
if isValidIp
|
||||
isValidAddress = not StringUtils.IsNullOrEmpty(address)
|
||||
if isValidAddress
|
||||
m.top.url = `${address}/invidious/login`
|
||||
else
|
||||
m.urlLabel.text = "No IP address found"
|
||||
|
||||
@@ -7,12 +7,12 @@ end function
|
||||
|
||||
function OnNodeReady()
|
||||
address = m.webserver@.GetServerAddress(invalid)
|
||||
isValidIp = not StringUtils.IsNullOrEmpty(address)
|
||||
if isValidIp
|
||||
isValidAddress = not StringUtils.IsNullOrEmpty(address)
|
||||
if isValidAddress
|
||||
m.top.url = address
|
||||
end if
|
||||
m.top.findNode("noInternet").visible = not isValidIp
|
||||
m.top.findNode("yesInternet").visible = isValidIp
|
||||
m.top.findNode("noInternet").visible = not isValidAddress
|
||||
m.top.findNode("yesInternet").visible = isValidAddress
|
||||
end function
|
||||
|
||||
function OnUrlSet()
|
||||
|
||||
@@ -5,7 +5,7 @@ function VideoContentTask(input as object) as object
|
||||
contentNode = input.content
|
||||
invidiousNode = input.invidious
|
||||
preferencesNode = input.preferences
|
||||
playletServerUrl = input.playletServerUrl
|
||||
playletServerPort = input.playletServerPort
|
||||
|
||||
if m.top.cancel
|
||||
return invalid
|
||||
@@ -35,7 +35,7 @@ function VideoContentTask(input as object) as object
|
||||
contentNode.title = metadata.title
|
||||
contentNode.secondaryTitle = metadata.author
|
||||
|
||||
streamUrls = CreateStreamUrls(metadata, service, preferencesNode, playletServerUrl)
|
||||
streamUrls = CreateStreamUrls(metadata, service, preferencesNode, playletServerPort)
|
||||
contentNode.url = streamUrls[0]
|
||||
|
||||
SetCaptions(metadata, service, contentNode)
|
||||
@@ -52,7 +52,7 @@ function VideoContentTask(input as object) as object
|
||||
}
|
||||
end function
|
||||
|
||||
function CreateStreamUrls(metadata as object, service as Invidious.InvidiousService, preferences as object, playletServerUrl as string) as object
|
||||
function CreateStreamUrls(metadata as object, service as Invidious.InvidiousService, preferences as object, playletServerPort as integer) as object
|
||||
instance = service.GetInstance()
|
||||
proxyVideos = preferences["invidious.proxy_videos"]
|
||||
|
||||
@@ -65,9 +65,9 @@ function CreateStreamUrls(metadata as object, service as Invidious.InvidiousServ
|
||||
|
||||
if preferredQuality = "720p"
|
||||
AddStreamUrls(streamUrls, metadata, service, proxyVideos)
|
||||
AddDashUrls(streamUrls, metadata, proxyVideos, playletServerUrl)
|
||||
AddDashUrls(streamUrls, metadata, proxyVideos, playletServerPort)
|
||||
else
|
||||
AddDashUrls(streamUrls, metadata, proxyVideos, playletServerUrl)
|
||||
AddDashUrls(streamUrls, metadata, proxyVideos, playletServerPort)
|
||||
AddStreamUrls(streamUrls, metadata, service, proxyVideos)
|
||||
end if
|
||||
end if
|
||||
@@ -84,11 +84,11 @@ function AddHlsUrls(streamUrls as object, metadata as object, proxyVideos as str
|
||||
AddUrls(streamUrls, hlsUrl, hlsUrlLocal, proxyVideos)
|
||||
end function
|
||||
|
||||
function AddDashUrls(streamUrls as object, metadata as object, proxyVideos as string, playletServerUrl as string) as void
|
||||
function AddDashUrls(streamUrls as object, metadata as object, proxyVideos as string, playletServerPort as integer) as void
|
||||
#if LOCAL_DASH
|
||||
' Redirect to Playet's local web server, where will will be
|
||||
' dynamically generating the DASH manifest.
|
||||
dashUrl = `${playletServerUrl}/api/dash?v=${metadata.videoId}`
|
||||
dashUrl = `http://127.0.0.1:${playletServerPort}/api/dash?v=${metadata.videoId}`
|
||||
#else
|
||||
if metadata.dashUrl = invalid
|
||||
return
|
||||
@@ -168,4 +168,3 @@ function SetCaptions(metadata as object, service as object, contentNode as objec
|
||||
contentNode.ClosedCaptions = True
|
||||
contentNode.SubtitleTracks = subtitleTracks
|
||||
end function
|
||||
|
||||
@@ -72,7 +72,7 @@ function StartVideoContentTask(videoContentNode as object)
|
||||
content: videoContentNode,
|
||||
invidious: m.top.invidious,
|
||||
preferences: m.top.preferences,
|
||||
playletServerUrl: m.top.webServer@.GetServerAddress(invalid)
|
||||
playletServerPort: m.top.webServer.port
|
||||
}, OnVideoContentTaskResults)
|
||||
end function
|
||||
|
||||
|
||||
Reference in new issue
Block a user