Begin looking into audio solutions
This commit is contained in:
parent
2964c36b45
commit
a76eacb624
|
@ -22,12 +22,7 @@ function VideoContent(id) as object
|
|||
meta = ItemMetaData(id)
|
||||
content.title = meta.Name
|
||||
|
||||
container = meta.json.mediaSources[0].container
|
||||
if container = invalid
|
||||
container = ""
|
||||
else if container = "m4v" or container = "mov"
|
||||
container = "mp4"
|
||||
end if
|
||||
container = getContainerType(meta)
|
||||
|
||||
content.url = buildURL(Substitute("Videos/{0}/stream", id), {
|
||||
Static: "true",
|
||||
|
@ -39,6 +34,8 @@ function VideoContent(id) as object
|
|||
content.streamformat = container
|
||||
content.switchingStrategy = ""
|
||||
|
||||
' todo - audioFormat is read only
|
||||
content.audioFormat = getAudioFormat(meta)
|
||||
|
||||
if server_is_https() then
|
||||
content.setCertificatesFile("common:/certs/ca-bundle.crt")
|
||||
|
@ -46,3 +43,35 @@ function VideoContent(id) as object
|
|||
|
||||
return content
|
||||
end function
|
||||
|
||||
function getContainerType(meta as object) as string
|
||||
if meta.json.mediaSources = invalid then return ""
|
||||
|
||||
container = meta.json.mediaSources[0].container
|
||||
if container = invalid
|
||||
container = ""
|
||||
else if container = "m4v" or container = "mov"
|
||||
container = "mp4"
|
||||
end if
|
||||
|
||||
return container
|
||||
end function
|
||||
|
||||
function getAudioFormat(meta as object) as string
|
||||
if meta.json.mediaSources = invalid then return ""
|
||||
|
||||
audioInfo = getAudioInfo(meta)
|
||||
if audioInfo.count() = 0 then return ""
|
||||
return audioInfo[0].codec
|
||||
end function
|
||||
|
||||
|
||||
function getAudioInfo(meta as object) as object
|
||||
results = []
|
||||
for each source in meta.json.mediaSources[0].mediaStreams
|
||||
if source["type"] = "Audio"
|
||||
results.push(source)
|
||||
end if
|
||||
end for
|
||||
return results
|
||||
end function
|
||||
|
|
Loading…
Reference in New Issue
Block a user