sebastien
Joined: 21 Sep 2007 Posts: 4
|
Posted: Thu Dec 13, 2007 11:18 am Post subject: TV Channel Changer |
|
|
It's not possible to use the COM object "Unreal.TVChanger" during the streaming with my TV card. So, I write the following script to change the channel in the LiveServer configuration file.
| Code: |
function SetChannelInXml(iNumChannel, iCountryCode)
on error resume next
dim xmlFilePath
dim xmlTVNode
dim xmlNamespace
xmlFilePath = "C:\Program Files\UnrealStreaming\ULiveServer\ULiveMediaGrabber.config"
xmlNamespace = "umedia:"
xmlTVNode = "//" & xmlNamespace & "LiveMediaSourceConfig" & "/" & xmlNamespace & "Source" & "/" & xmlNamespace & "Video" & "/" & xmlNamespace & "TV"
dim xml
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.resolveExternals = False
xml.validateOnParse = False
xml.load (xmlFilePath)
if xml.parseError.errorcode<>0 then
response.write "XML TV File KO : " & xmlFilePath
else
xml.setProperty "SelectionNamespaces", "xmlns:umedia='http://umediaserver.net/LiveMediaConfig'"
xml.setProperty "SelectionLanguage", "XPath"
Dim node
Set node = xml.selectSingleNode(xmlTVNode)
if not node is Nothing Then
node.setAttribute "Channel", iNumChannel
node.setAttribute "CountryCode", iCountryCode
xml.save (xmlFilePath)
else
response.write "XML TV Node KO : " & xmlTVNode
end if
end if
end function
|
It's working well but I need to wait about 15 seconds before to restart the streaming because the last source has to be disconnected.
I wanted to use the 'Disconnect' method of the "LiveConn.DynBroadcast" COM object to force the LiveServer to read the file and to relaunch the streaming but the live source never stop the streaming. Is it normal ? |
|