Function ShowMessageDialog_ChooseQuality(episode) As Void
port = CreateObject("roMessagePort")
dialog = CreateObject("roMessageDialog")
dialog.SetMessagePort(port)
dialog.SetTitle("Choose Links")
dialog.SetText("Choose the video Links to play")
count = 1
for each stream in episode.streams
dialog.AddButton(count, ValidStr(stream.texturl))
count = count + 1
next
dialog.EnableBackButton(true)
dialog.Show()
While True
dlgMsg = wait(0, dialog.GetMessagePort())
If type(dlgMsg) = "roMessageDialogEvent"
if dlgMsg.isButtonPressed()
index = dlgMsg.GetIndex()
if index >= 1 and index < count
dialog.close()
retval = ShowVideoScreen(episode,episode.streams[index-1].url)
exit while
end if
else if dlgMsg.isScreenClosed()
exit while
end if
end if
end while
End Function