当我通过 ChromeCast 设备将视频从我的 Android 应用程序共享到电视时。我有一个线程每秒获取当前流位置,以更新我的应用程序上视频的当前时间。
double position = messageStream.getStreamPosition();
但有时这个函数会在几秒钟内返回相同的值。所以我的应用程序无法连续显示。
这是我记录的:
11-07 14:41:36.567: E/CastPlayerActivity(27190): position 587.3914184570313
11-07 14:41:36.637: E/CastPlayerActivity(27190): position 587.3914184570313
11-07 14:41:37.638: E/CastPlayerActivity(27190): position 587.3914184570313
11-07 14:41:38.639: E/CastPlayerActivity(27190): position 587.3914184570313
11-07 14:41:39.640: E/CastPlayerActivity(27190): position 587.3914184570313
11-07 14:41:40.641: E/CastPlayerActivity(27190): position 587.3914184570313
11-07 14:41:41.652: E/CastPlayerActivity(27190): position 588.5733334960937
11-07 14:41:42.663: E/CastPlayerActivity(27190): position 589.5793334960938
11-07 14:41:43.664: E/CastPlayerActivity(27190): position 590.5843334960938
11-07 14:41:44.665: E/CastPlayerActivity(27190): position 591.5893334960938
有谁知道为什么它有时会返回相同的值。
谢谢