HLS enables playlist support in the sense that you can mix segments from different sources. For example, you could have your main content intermixed with ads. The Roku will take care of the different pts values from the different encoding sources.
However, there is no way to do playlists of .mp4 files without buffering. If you can live with buffering between each stream in your playlist, the following solution would work:
Function displayVideo()
print "Displaying video: "
p = CreateObject("roMessagePort")
video = CreateObject("roVideoScreen")
video.setMessagePort(p)
video2 = CreateObject("roVideoScreen")
p2 = CreateObject("roMessagePort")
video2.setMessagePort(p2)
videoclip = CreateObject("roAssociativeArray")
videoclip.StreamBitrates = [0]
videoclip.StreamQualities = ["HD"]
videoclip.StreamUrls = ["yourFirstStreamURL"]
videoclip.StreamFormat="mp4"
videoclip2 = CreateObject("roAssociativeArray")
videoclip2.StreamBitrates = [0]
videoclip2.StreamUrls = ["yourSecondStreamURL"]
videoclip2.StreamQualities = ["HD"]
videoclip2.StreamFormat = "mp4"
lastSavedPos = 0
statusInterval = 10 'position must change by more than this number of seconds before saving
video.SetContent(videoclip)
video.SetPositionNotificationPeriod( 1 )
video.show()
pos1 = videoEventLoop(video, videoclip)
video2.SetContent(videoclip2)
video2.show()
pos2 = videoEventLoop(video2, videoclip2)
End Function
'*************************************************************
'** videoEventLoop()
'*************************************************************
Function videoEventLoop(video As Object, videoclip As Object, nowpos=0 As Integer) As Integer
validateParam(video, "roVideoScreen", "videoEventLoop")
validateParam(videoclip, "roAssociativeArray", "videoEventLoop")
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"
return nowpos
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()
return -1
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
end if
end while
return nowpos
End Function
--Kevin