Function Play_Movies( url as string, movs as string, HD as integer, live as integer ) as void
? "* Play_Movies " url "/" movs
pm = CreateObject("roAssociativeArray")
pm.ContentType = "movie"
pm.HDBranded = false
pm.IsHD = false
pm.StreamFormat = Get_Movie_Type( movs )
pm.StreamBitrates = [0] ' was 1500
if HD
pm.StreamQualities = ["HD"]
else
pm.StreamQualities = ["SD"]
end if
if live then
pm.Live = true
pm.StreamURLs = [Encode(url)]
else
if movs = " "
pm.StreamURLs = [Encode(url+"dummy.mp4")]
else
pm.StreamURLs = [Encode(url+movs)]
end if
end if
? "URL = " pm.StreamURLs
resume = 0
for i=0 to m.resume.Count()-1
if pm.StreamURLs[0] = m.resume.Lookup( "url" )
if Resume_Check(pm.StreamURLs[0]) > 0
resume = m.resume.Lookup( "time" ).toint()
? "resume time " resume
end if
m.resume.Delete( i )
exit for
end if
end for
? pm
? pm.streamurls
? pm.streamqualities
? pm.streambitrates
port = CreateObject("roMessagePort")
scr = CreateObject("roVideoScreen")
scr.SetContent(pm)
scr.SetPositionNotificationPeriod( 1 )
scr.SetMessagePort(port)
scr.Seek(resume*1000) <------------------ Crashes
scr.Show()
scr.Seek(resume*1000) <------------------ Crashes
------------------------------------------
* Ended up with this.
while true
msg = wait(1000, port)
if msg <> invalid
? "msg = " msg.GetMessage() " index = " msg.GetIndex()
? "info = " msg.GetInfo()
end if
if msg = invalid
if timer = 1 and resume > 0 ' wait 2 seconds before seek !
scr.Seek(resume*1000) <------------------
resume = 0
end if
timer = timer + 1