被称为OnBufferingUpdate事件每秒,而玩? [英] Is OnBufferingUpdate event called every second while playing?

查看:270
本文介绍了被称为OnBufferingUpdate事件每秒,而玩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在写一个应用程序为Android,包括媒体播放器。因为我想向用户显示玩家的当前状态,我想保持当前播放时间和更新缓冲进度。

I am currently writing an app for Android, including a media player. As I want to show the user the current state of the player, I want to keep the time currently played and the buffering progress updated.

实施缓冲完成 MediaPlayer.OnBufferingUpdate ,我才明白,这一个被称为每一秒,即使在接口之后。那么它报告的百分比 100 每一秒。

After implementing the interface MediaPlayer.OnBufferingUpdate, I realized, that this one is called every second, even after the buffering has finished. It then reports a percentage of 100 every second.

现在我的问题:

在某处指定这种行为?我可以安全地使用 MediaPlayer.OnBufferingUpdate 事件来更新我的上场时间,或者我应该实现自己的定时器,以保持一个更新?有另一种情况下,我可以使用,同时播放这就是所谓的每一秒(不触发暂停或之后完成)?

Is this behavior specified somewhere? Can I safely use the MediaPlayer.OnBufferingUpdate event to update my playing-time, or should I implement a timer my own to keep that one updated? Is there another event I can use, that's called every second while playing (not triggered on PAUSE or after FINISH)?

我发现这里的问题,LINK - <一个href=\"http://stackoverflow.com/questions/22069783/android-onbufferingupdate-not-called-after-reaching-100\">Android: onBufferingUpdate()不叫达到100%后 - 在@ ThaMe90指向的文件 - 但我没有得到什么应该是虫在这里...

I found that question here, LINK - Android: onBufferingUpdate() not called after reaching 100% - where @ThaMe90 points to the documentation - but I don't get what should be the "bug" here ...

推荐答案

那么,由于<一个href=\"http://developer.android.com/reference/android/media/MediaPlayer.OnBufferingUpdateListener.html#onBufferingUpdate(android.media.MediaPlayer,%20int)\"相对=nofollow>文档,这种方法的叫缓冲来更新状态,所以当你达到100%,缓冲地位不应再更新(这是有道理的,对吗?)。

Well, due to documentation, this method is "called to update status in buffering", so when you reach 100%, buffering status shouldn't updated anymore (it makes sense, am I right?).

不幸的是,有一种疾病,它消耗的软件开发的Andr​​oid平台的过程 - 原始设备制造商修改这个平台,由于他们的需求。我是pretty确保它是其中的​​一个例子。

Unfortunately, there is a disease, which consumes process of developing software for Android platform - OEMs modify this platform due to their needs. I am pretty sure it's one of those examples.

我已经测试这种方法叫在不同的设备,这里是我的观察结果:

I've test is this method called on different devices and here is the result of my observation:


  • onBufferingUpdate方法的在所有三星设备的(重修改OS)
  • 的达到100%之后调用
  • onBufferingUpdate方法的是不是所有的摩托的G,其中达到100%略作修改后的And​​r​​oid不再叫

  • onBufferingUpdate method is called after reaching 100% on all of Samsung devices (heavy modified OS)
  • onBufferingUpdate method isn't called anymore after reaching 100% on all of Moto G, which has slightly modified Android

好了,它看起来像一个bug,这成为三星设备功能;)

Well, it looks like a bug, which became a feature on Samsung devices ;)

这篇关于被称为OnBufferingUpdate事件每秒,而玩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆