Chromecast API - 状态更新中的回调延迟问题
Chromecast API - callback delay issue in statusupdate
我正在开发 chromecast 应用程序,我在调试该应用程序时发现了以下问题。
如果我在特定时间安排一个事件,该事件会在 chromecast 中有一些延迟,并且它会延迟大约 600 毫秒通知 statusupdate 侦听器。
让我举个例子解释一下:
1.Suppose we have an event at ’00:21:33:400’ (hh:mm:ss:ms), when we trigger the event exactly at specific given time we observed that it
is applied late in Chromecast (approximately 600 milliseconds) that is
the reason we are triggering event signals 600 milliseconds before the
exact event time.
2.And also observed that sometimes chromecast device is notifying the media status updates very late (i.e.. not triggering the
‘StatusUpdate’ callback) when event applied. Due to this app may not
schedule the successive event if chromecast is updated with the
streaming position which is greater than the next event start time.
That is if next event is there at ’00:21:34:100’ time and if
chromecast is notified with the streaming position ‘00:21:34:300’, in
this case app will ignore the event and schedule/find the next
successive event which is greater than the ‘00:21:34:300’ streaming
position.
我已经尝试了很多方法来解决这个问题,你能帮我解决这个问题吗?
终于解决了我的问题。
我通过在styled receiver中调试日志验证了上述问题,观察到没有延迟。
而是在发件人应用程序中,我使用了不同的方法来获取当前的媒体流位置。
即'mRemoteMediaPlayer.getApproximateStreamPosition()' - 它为我提供了前景和背景中的确切流媒体位置。
而我之前使用的是 'mediaStatus.getStreamPosition()' 方法,但有时它会给我不准确的流媒体位置。
我正在开发 chromecast 应用程序,我在调试该应用程序时发现了以下问题。
如果我在特定时间安排一个事件,该事件会在 chromecast 中有一些延迟,并且它会延迟大约 600 毫秒通知 statusupdate 侦听器。
让我举个例子解释一下:
1.Suppose we have an event at ’00:21:33:400’ (hh:mm:ss:ms), when we trigger the event exactly at specific given time we observed that it is applied late in Chromecast (approximately 600 milliseconds) that is the reason we are triggering event signals 600 milliseconds before the exact event time.
2.And also observed that sometimes chromecast device is notifying the media status updates very late (i.e.. not triggering the ‘StatusUpdate’ callback) when event applied. Due to this app may not schedule the successive event if chromecast is updated with the streaming position which is greater than the next event start time. That is if next event is there at ’00:21:34:100’ time and if chromecast is notified with the streaming position ‘00:21:34:300’, in this case app will ignore the event and schedule/find the next successive event which is greater than the ‘00:21:34:300’ streaming position.
我已经尝试了很多方法来解决这个问题,你能帮我解决这个问题吗?
终于解决了我的问题。
我通过在styled receiver中调试日志验证了上述问题,观察到没有延迟。
而是在发件人应用程序中,我使用了不同的方法来获取当前的媒体流位置。
即'mRemoteMediaPlayer.getApproximateStreamPosition()' - 它为我提供了前景和背景中的确切流媒体位置。
而我之前使用的是 'mediaStatus.getStreamPosition()' 方法,但有时它会给我不准确的流媒体位置。