如何从 Roku 获取详细日志?

How do I get detailed logs from the Roku?

我目前在 roku 开发者网站提供的简单视频播放器模板上测试 HLS 流。

如果我在 roku 上测试频道并且我的 HLS 流失败,如何查看和获取失败原因的详细日志?

我发现对任何 Roku 应用程序进行故障排除的最简单方法是通过 telnet 旁加载您的内容并将语句打印到您的控制台。您可以从 Roku developer docs 获得有关如何在盒子上启用开发者模式的详细信息,然后您可以简单地远程登录,如下所示:

telnet [ip address] 8085

届时,您将看到从应用程序中打印出来的任何内容。例如,如果您从视频播放器打印消息:

while true
  msg = wait(0, port)

  if type(msg) = "roVideoScreenEvent" then
     if msg.isRequestFailed()
       print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
     elseif msg.isStatusMessage()
       ...etc
     end if
  end if
end while

或者,如果您无法访问有问题的设备,您可以设置 Google 分析并以这种方式报告。

确定 HLS 流失败原因的最佳方法是侦听 roVideoScreenEvent.isRequestFailed() event in your roVideoScreen event loop. If that doesn't give you the information you need, you can add an roSystemLog 并启用 "http.connect" 和 "http.error" 事件以查看播放器是否正在请求预期的请求这些 URL 时流 and/or 的 URL 出错。