device=CreateObject("roDeviceInfo")
hvideo = CreateObject("roHttpAgent")
hvideoheaders = {
"Device": device.GetDeviceUniqueId(),
"DeviceProf": device.GetModelDisplayName()+"("+device.GetModel()+";"+device.GetVersion()+";Roku;roku)",
"Version": "C4.9.9_S0",
"x-roku-reserved-dev-id": "",
}
hvideo.SetHeaders(hvideoheaders)
'set videoContent Parameters
videoContent = createObject("RoSGNode", "ContentNode")
videoContent.url = streamUrl
videoContent.Title = m.top.item.Title
videoContent.StreamFormat = "hls"
videoContent.SubtitleConfig = subtitle_config
videoContent.HttpSendClientCertificates = true
'Set Video
m.video = m.top.findNode("musicvideos")
m.video.SetConnectionTimeout(30)
'm.video.notificationInterval = 30
m.video.observeField("state", "stateChanged")
m.video.observeField("streamInfo", "streamInfoChanged")
m.video.observeField("streamingSegment", "streamingSegmentChanged")
m.video.content = videoContent
m.video.setHttpAgent(hvideo)
m.video.control = "play"
headers = []
headers.push("x-roku-reserved-dev-id:")
headers.push("Device:" + device.GetDeviceUniqueId())
headers.push("DeviceProf:" + device.GetModelDisplayName()+"("+device.GetModel()+";"+device.GetVersion()+";Roku;roku)")
headers.push("Version:C4.9.9_S0")
videoContent.HttpHeaders = headers
Hi, I am using the VideoListExample file and I need to add a Http Header when I call the URLs of the streams stored in the XML.
The Http Header is the user agent and will be the same for each stream.
Can someone help me with the right piece of code to add?
Thanks