i have a problem, i have two similar video "ISM" urls which are working
they are:
1.
http://sanatana.tv/Clients/Encoder1_80.ism/Manifest2.
http://public.agnozine.com/Clients/Enco ... m/Manifestbur when i play rovideoplayer 2 url is working fine, but not 1 url the stream starts and end immediately.
can any one find whats the problem going on?
please find my code for your reference:
Function showSpringboardScreen(item as object) As Boolean
port = CreateObject("roMessagePort")
screen = CreateObject("roSpringboardScreen")
print "showSpringboardScreen"
screen.SetMessagePort(port)
screen.AllowUpdates(false)
if item <> invalid and type(item) = "roAssociativeArray"
screen.SetContent(item)
endif
screen.SetDescriptionStyle("generic") 'audio, movie, video, generic
' generic+episode=4x3,
screen.ClearButtons()
screen.AddButton(1,"Play")
screen.AddButton(2,"Go Back")
screen.SetStaticRatingEnabled(false)
screen.AllowUpdates(true)
screen.Show()
downKey=3
selectKey=6
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roSpringboardScreenEvent"
if msg.isScreenClosed()
print "Screen closed"
exit while
else if msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
if msg.GetIndex() = 1
displayVideo("")
else if msg.GetIndex() = 2
return true
endif
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
else
print "wrong type.... type=";msg.GetType(); " msg: "; msg.GetMessage()
endif
end while
return true
End Function
'*************************************************************
'** displayVideo()
'*************************************************************
Function displayVideo(args As Dynamic)
print "Displaying video: "
p = CreateObject("roMessagePort")
video = CreateObject("roVideoScreen")
video.setMessagePort(p)
bitrates = [0]
'Swap the commented values below to play different video clips...
urls = ["http://sanatana.tv/Clients/Encoder1_80.ism/Manifest"]
qualities = ["HD"]
StreamFormat = "ism"
title = "Craig Venter Synthetic Life"
srt = "file://pkg:/source/craigventer.srt"
if type(args) = "roAssociativeArray"
if type(args.url) = "roString" and args.url <> "" then
urls[0] = args.url
end if
if type(args.StreamFormat) = "roString" and args.StreamFormat <> "" then
StreamFormat = args.StreamFormat
end if
if type(args.title) = "roString" and args.title <> "" then
title = args.title
else
title = ""
end if
if type(args.srt) = "roString" and args.srt <> "" then
srt = args.StreamFormat
else
srt = ""
end if
end if
videoclip = CreateObject("roAssociativeArray")
videoclip.StreamBitrates = bitrates
videoclip.StreamUrls = urls
videoclip.StreamQualities = qualities
videoclip.StreamFormat = StreamFormat
videoclip.Title = title
print "srt = ";srt
if srt <> invalid and srt <> "" then
videoclip.SubtitleUrl = srt
end if
video.SetContent(videoclip)
video.show()
lastSavedPos = 0
statusInterval = 10 'position must change by more than this number of seconds before saving
while true
msg = wait(0, video.GetMessagePort())
if type(msg) = "roVideoScreenEvent"
if msg.isScreenClosed() then 'ScreenClosed event
print "Closing video screen"
exit while
else if msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
if nowpos > 10000
end if
if nowpos > 0
if abs(nowpos - lastSavedPos) > statusInterval
lastSavedPos = nowpos
end if
end if
else if msg.isRequestFailed()
print "play failed: "; msg.GetMessage()
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
end if
end while
End Function