Flash视频播放良好,但时间和剩余时间不同步
可能是一个已知问题、我的代码问题或我的疏忽。
我用 Flash 创建了一个视频播放器。我已经让它通过 rtmp/rtmpt 播放渐进式流媒体,所以一切都很好。
我唯一的问题是,当视频播放时,播放时间和剩余时间的时间码不同步。因此,如果我的视频长 20 秒,并且已播放 5 秒,则播放时间将为 5 秒,剩余时间将为 16 秒,直到大约半秒后更新。
因此,即使它们都使用同一行代码进行设置,但不会同时更改。播放时间发生变化,然后一瞬间,剩余时间发生变化。
任何人都知道这可能是什么。也许是我的一个误判。也许我需要向上或向下舍入剩余时间。我怎样才能同步这两个时间。
我知道这可能是一个很难回答的问题,我已尽力解释它。
提前致谢。
Could be a known issue, an issue with my code or an oversight on my part.
I have created a video player in flash. I have got it playing progressive and streaming over rtmp/rtmpt so that is all fine.
My only issue is that when the video's are playing, the time-codes for time played and time remaining are not synced. So, if my video is 20 secs long and 5 have been played, time played will be 5secs, time remaining will be 16secs until it updates about half a second later.
So even though they are both being set with the same line of code, there are not changing at the same time. The time played changes, then a split second later the time remaining changes.
Anyone got any idea what this could be. Maybe a miscalculation on my part. Maybe I need to round up or down the remaining time. How can I sync the two times.
I understand this is probably an tough question to answer, I have done my best to explain it.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能就像更新每个项目的频率问题一样简单。
需要更多信息。这是自定义视频播放器吗?您使用 FLVPlayback 组件吗?你如何设定时间?
听起来当前时间和总时间比剩余时间更准确。如果这是一个自定义视频播放器,是否有任何原因而不是使用两个变量来表示剩余时间和播放时间,而不能仅使用变量设置播放时间,然后将剩余时间设置为 (totalTime - timePlayed )?这样,他们就会同步。
目前这只是猜测。需要更多信息。
This could be just as simple as an issue with how often you're updating each item.
More info is needed. Is this a custom video player? Are you using the FLVPlayback component? How are you setting the time?
It sounds like the current time and total time are more accurate than the time remaining. If this IS a custom video player, is there any reason why instead of using two variables for the time remaining and the time played you can't just set the time played using a variable and then set the time remaining to be (totalTime - timePlayed)? That way, they'll be in sync.
This is just guessing at this point. More info is needed.