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()
|
function OnNodeReady()
|
||||||
address = m.webserver@.GetServerAddress(invalid)
|
address = m.webserver@.GetServerAddress(invalid)
|
||||||
isValidIp = not StringUtils.IsNullOrEmpty(address)
|
isValidAddress = not StringUtils.IsNullOrEmpty(address)
|
||||||
if isValidIp
|
if isValidAddress
|
||||||
m.top.url = `${address}/invidious/login`
|
m.top.url = `${address}/invidious/login`
|
||||||
else
|
else
|
||||||
m.urlLabel.text = "No IP address found"
|
m.urlLabel.text = "No IP address found"
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ end function
|
|||||||
|
|
||||||
function OnNodeReady()
|
function OnNodeReady()
|
||||||
address = m.webserver@.GetServerAddress(invalid)
|
address = m.webserver@.GetServerAddress(invalid)
|
||||||
isValidIp = not StringUtils.IsNullOrEmpty(address)
|
isValidAddress = not StringUtils.IsNullOrEmpty(address)
|
||||||
if isValidIp
|
if isValidAddress
|
||||||
m.top.url = address
|
m.top.url = address
|
||||||
end if
|
end if
|
||||||
m.top.findNode("noInternet").visible = not isValidIp
|
m.top.findNode("noInternet").visible = not isValidAddress
|
||||||
m.top.findNode("yesInternet").visible = isValidIp
|
m.top.findNode("yesInternet").visible = isValidAddress
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnUrlSet()
|
function OnUrlSet()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ function VideoContentTask(input as object) as object
|
|||||||
contentNode = input.content
|
contentNode = input.content
|
||||||
invidiousNode = input.invidious
|
invidiousNode = input.invidious
|
||||||
preferencesNode = input.preferences
|
preferencesNode = input.preferences
|
||||||
playletServerUrl = input.playletServerUrl
|
playletServerPort = input.playletServerPort
|
||||||
|
|
||||||
if m.top.cancel
|
if m.top.cancel
|
||||||
return invalid
|
return invalid
|
||||||
@@ -35,7 +35,7 @@ function VideoContentTask(input as object) as object
|
|||||||
contentNode.title = metadata.title
|
contentNode.title = metadata.title
|
||||||
contentNode.secondaryTitle = metadata.author
|
contentNode.secondaryTitle = metadata.author
|
||||||
|
|
||||||
streamUrls = CreateStreamUrls(metadata, service, preferencesNode, playletServerUrl)
|
streamUrls = CreateStreamUrls(metadata, service, preferencesNode, playletServerPort)
|
||||||
contentNode.url = streamUrls[0]
|
contentNode.url = streamUrls[0]
|
||||||
|
|
||||||
SetCaptions(metadata, service, contentNode)
|
SetCaptions(metadata, service, contentNode)
|
||||||
@@ -52,7 +52,7 @@ function VideoContentTask(input as object) as object
|
|||||||
}
|
}
|
||||||
end function
|
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()
|
instance = service.GetInstance()
|
||||||
proxyVideos = preferences["invidious.proxy_videos"]
|
proxyVideos = preferences["invidious.proxy_videos"]
|
||||||
|
|
||||||
@@ -65,9 +65,9 @@ function CreateStreamUrls(metadata as object, service as Invidious.InvidiousServ
|
|||||||
|
|
||||||
if preferredQuality = "720p"
|
if preferredQuality = "720p"
|
||||||
AddStreamUrls(streamUrls, metadata, service, proxyVideos)
|
AddStreamUrls(streamUrls, metadata, service, proxyVideos)
|
||||||
AddDashUrls(streamUrls, metadata, proxyVideos, playletServerUrl)
|
AddDashUrls(streamUrls, metadata, proxyVideos, playletServerPort)
|
||||||
else
|
else
|
||||||
AddDashUrls(streamUrls, metadata, proxyVideos, playletServerUrl)
|
AddDashUrls(streamUrls, metadata, proxyVideos, playletServerPort)
|
||||||
AddStreamUrls(streamUrls, metadata, service, proxyVideos)
|
AddStreamUrls(streamUrls, metadata, service, proxyVideos)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
@@ -84,11 +84,11 @@ function AddHlsUrls(streamUrls as object, metadata as object, proxyVideos as str
|
|||||||
AddUrls(streamUrls, hlsUrl, hlsUrlLocal, proxyVideos)
|
AddUrls(streamUrls, hlsUrl, hlsUrlLocal, proxyVideos)
|
||||||
end function
|
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
|
#if LOCAL_DASH
|
||||||
' Redirect to Playet's local web server, where will will be
|
' Redirect to Playet's local web server, where will will be
|
||||||
' dynamically generating the DASH manifest.
|
' 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
|
#else
|
||||||
if metadata.dashUrl = invalid
|
if metadata.dashUrl = invalid
|
||||||
return
|
return
|
||||||
@@ -168,4 +168,3 @@ function SetCaptions(metadata as object, service as object, contentNode as objec
|
|||||||
contentNode.ClosedCaptions = True
|
contentNode.ClosedCaptions = True
|
||||||
contentNode.SubtitleTracks = subtitleTracks
|
contentNode.SubtitleTracks = subtitleTracks
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ function StartVideoContentTask(videoContentNode as object)
|
|||||||
content: videoContentNode,
|
content: videoContentNode,
|
||||||
invidious: m.top.invidious,
|
invidious: m.top.invidious,
|
||||||
preferences: m.top.preferences,
|
preferences: m.top.preferences,
|
||||||
playletServerUrl: m.top.webServer@.GetServerAddress(invalid)
|
playletServerPort: m.top.webServer.port
|
||||||
}, OnVideoContentTaskResults)
|
}, OnVideoContentTaskResults)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user